Refactor: move service logic out of api routes and into separate files

This commit is contained in:
Aaron William Po
2023-05-14 17:12:14 -04:00
parent 60e76089f3
commit 5c91c6ab08
11 changed files with 118 additions and 54 deletions

View File

@@ -1,6 +1,14 @@
import DBClient from '@/prisma/DBClient';
const findBeerPostLikeById = async (beerPostId: string, likedById: string) =>
interface FindBeerPostLikeByIdArgs {
beerPostId: string;
likedById: string;
}
const findBeerPostLikeById = async ({
beerPostId,
likedById,
}: FindBeerPostLikeByIdArgs) =>
DBClient.instance.beerPostLike.findFirst({ where: { beerPostId, likedById } });
export default findBeerPostLikeById;