Working on Avatar upload image. Now working.

This commit is contained in:
charles-gauthereau
2024-11-11 19:42:58 +01:00
parent c0ab220961
commit debc8272cc
9 changed files with 50 additions and 10 deletions
@@ -0,0 +1,24 @@
"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,
}
});