mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-02-16 20:13:49 +00:00
Refactor beer by id page
Extracted services to separate files.
This commit is contained in:
11
services/BeerComment/getBeerCommentCount.ts
Normal file
11
services/BeerComment/getBeerCommentCount.ts
Normal 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;
|
||||
Reference in New Issue
Block a user