mirror of
https://github.com/Sonny93/my-links.git
synced 2025-12-10 07:25:35 +00:00
15 lines
299 B
TypeScript
15 lines
299 B
TypeScript
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,
|
|
},
|
|
});
|
|
}
|