feat(wip): create models to access db data

This commit is contained in:
Sonny
2023-05-31 19:27:48 +02:00
parent e7e7e0c950
commit a89fa471e0
19 changed files with 213 additions and 88 deletions

View File

@@ -0,0 +1,14 @@
import { Link, User } from "@prisma/client";
import prisma from "utils/prisma";
export default async function getUserLink(user: User, id: Link["id"]) {
return await prisma.link.findFirst({
where: {
id,
authorId: user.id,
},
include: {
category: true,
},
});
}