mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
24 lines
489 B
TypeScript
24 lines
489 B
TypeScript
"use server"
|
|
import {userAction} from "@/safe-actions";
|
|
import {z} from "zod";
|
|
import {prisma} from "@/prisma";
|
|
|
|
|
|
export const updateImageUserAction = userAction
|
|
.schema(z.string())
|
|
.action(async ({parsedInput, ctx}) => {
|
|
|
|
const user = await prisma.user.update({
|
|
where: {
|
|
id: ctx.user.id,
|
|
},
|
|
data: {
|
|
image: parsedInput,
|
|
}
|
|
})
|
|
|
|
|
|
return {
|
|
data: user,
|
|
}
|
|
}); |