Refactor beer by id page

Extracted services to separate files.
This commit is contained in:
Aaron William Po
2023-03-27 19:02:38 -04:00
parent 2efc506250
commit d8a8dad37f
5 changed files with 28 additions and 9 deletions

View File

@@ -0,0 +1,11 @@
import DBClient from '@/prisma/DBClient';
const getBeerCommentCount = async (beerPostId: string) => {
const count = await DBClient.instance.beerComment.count({
where: { beerPostId },
});
return count;
};
export default getBeerCommentCount;

View File

@@ -0,0 +1,11 @@
import DBClient from '@/prisma/DBClient';
const getBeerPostLikeCount = async (beerPostId: string) => {
const count = await DBClient.instance.beerPostLike.count({
where: { beerPostId },
});
return count;
};
export default getBeerPostLikeCount;