mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
16 lines
499 B
TypeScript
16 lines
499 B
TypeScript
"use server";
|
|
import { db } from "@/db";
|
|
import { userAction } from "@/safe-actions";
|
|
import { eq } from "drizzle-orm";
|
|
import { z } from "zod";
|
|
import * as drizzleDb from "@/db";
|
|
|
|
|
|
export const updateImageUserAction = userAction.schema(z.string()).action(async ({ parsedInput, ctx }) => {
|
|
const [updatedUser] = await db.update(drizzleDb.schemas.user).set({ image: parsedInput }).where(eq(drizzleDb.schemas.user.id, ctx.user.id)).returning();
|
|
|
|
return {
|
|
data: updatedUser,
|
|
};
|
|
});
|