Skip to content

Commit 8e97d08

Browse files
committed
feat(models): add user profile retrieval functionality
1 parent f977c22 commit 8e97d08

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

models/user.ts

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { prisma } from "@/lib/prisma";
2+
3+
export type ProfileProps = string | undefined;
4+
5+
export async function getUserProfile(uid: ProfileProps) {
6+
const user = await prisma.users.findFirst({
7+
include: {
8+
profiles: {
9+
include: {
10+
countries: true
11+
}
12+
},
13+
},
14+
where: {
15+
id: uid
16+
}
17+
})
18+
return user
19+
}

0 commit comments

Comments
 (0)