Files
hipmi/src/app_modules/fun_global/get_user_profile.ts
Bagasbanuna02 f419559379 fix lib
deskripsi:
- pindah lib di dalam app ke src ( lib setara app dan app_modules )
2025-02-12 10:57:10 +08:00

33 lines
678 B
TypeScript

"use server";
import prisma from "@/lib/prisma";
import { revalidatePath } from "next/cache";
export async function funGetUserProfile( userId: string ) {
const user = await prisma.user.findUnique({
where: {
id: userId,
},
select: {
id: true,
username: true,
nomor: true,
Profile: {
select: {
id: true,
alamat: true,
email: true,
jenisKelamin: true,
name: true,
imageId: true,
imageBackgroundId: true,
},
},
},
});
revalidatePath("/dev/home");
revalidatePath("/dev/katalog/view");
return user;
}