mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
Working on Avatar upload image. Now working.
This commit is contained in:
@@ -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,
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user