Refactor: further extract controller logic from routers

This commit is contained in:
Aaron William Po
2023-12-04 00:59:13 -05:00
parent da8d5806bc
commit 4b2ce394c1
28 changed files with 325 additions and 308 deletions

View File

@@ -8,7 +8,7 @@ interface GetBeerPostsByBeerStyleIdArgs {
pageNum: number;
}
const getBeerPostsByBeerStyleId = async ({
const getAllBeerPostsByBreweryId = async ({
pageNum,
pageSize,
breweryId,
@@ -44,4 +44,4 @@ const getBeerPostsByBeerStyleId = async ({
return beers;
};
export default getBeerPostsByBeerStyleId;
export default getAllBeerPostsByBreweryId;

View File

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