fix
Desc: - Penambahan function - Perubahan tampilan
This commit is contained in:
34
src/app_modules/fun/get_user_profile.ts
Normal file
34
src/app_modules/fun/get_user_profile.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
"use server";
|
||||
import prisma from "@/app/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: {
|
||||
alamat: true,
|
||||
email: true,
|
||||
jenisKelamin: true,
|
||||
name: true,
|
||||
ImageProfile: {
|
||||
select: {
|
||||
url: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
revalidatePath("/dev/home");
|
||||
revalidatePath("/dev/katalog/view")
|
||||
|
||||
return user;
|
||||
}
|
||||
Reference in New Issue
Block a user