Add basic CRUD for artists
This commit is contained in:
21
src/actions/artists/updateArtist.ts
Normal file
21
src/actions/artists/updateArtist.ts
Normal file
@ -0,0 +1,21 @@
|
||||
"use server"
|
||||
|
||||
import prisma from "@/lib/prisma";
|
||||
import { artistSchema } from "@/schemas/artists/artistSchema";
|
||||
import * as z from "zod/v4";
|
||||
|
||||
export async function updateArtist(
|
||||
values: z.infer<typeof artistSchema>,
|
||||
id: string
|
||||
) {
|
||||
return await prisma.artist.update({
|
||||
where: {
|
||||
id: id
|
||||
},
|
||||
data: {
|
||||
displayName: values.displayName,
|
||||
slug: values.slug,
|
||||
nickname: values.nickname
|
||||
}
|
||||
})
|
||||
}
|
Reference in New Issue
Block a user