Desc:
- Penambahan function
- Perubahan tampilan
This commit is contained in:
2023-10-09 15:50:15 +08:00
parent 6281452441
commit ca66c3d2d8
12 changed files with 172 additions and 96 deletions

View 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;
}