16 lines
396 B
TypeScript
16 lines
396 B
TypeScript
"use server"
|
|
|
|
import prisma from "@/lib/prisma";
|
|
import { albumSchema } from "@/schemas/albums/albumSchema";
|
|
import * as z from "zod/v4";
|
|
|
|
export async function createAlbum(values: z.infer<typeof albumSchema>) {
|
|
return await prisma.album.create({
|
|
data: {
|
|
name: values.name,
|
|
slug: values.slug,
|
|
description: values.description,
|
|
galleryId: values.galleryId
|
|
}
|
|
})
|
|
} |