Fix beer likes and db client

This commit is contained in:
Aaron William Po
2023-02-13 13:08:05 -05:00
parent 80261a713b
commit 7240cb0792
6 changed files with 36 additions and 17 deletions

View File

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