mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-02-16 20:13:49 +00:00
Refactor: update beer post services, comment services
This commit is contained in:
@@ -11,7 +11,6 @@ import {
|
||||
createBeerPostCommentService,
|
||||
getAllBeerCommentsService,
|
||||
deleteBeerCommentByIdService,
|
||||
getBeerPostCommentCountService,
|
||||
} from '@/services/comments/beer-comment';
|
||||
|
||||
import {
|
||||
@@ -98,14 +97,12 @@ export const getAllBeerPostComments = async (
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
const { page_size, page_num } = req.query;
|
||||
|
||||
const comments = await getAllBeerCommentsService({
|
||||
const { comments, count } = await getAllBeerCommentsService({
|
||||
beerPostId,
|
||||
pageNum: parseInt(page_num, 10),
|
||||
pageSize: parseInt(page_size, 10),
|
||||
});
|
||||
|
||||
const count = await getBeerPostCommentCountService({ beerPostId });
|
||||
|
||||
res.setHeader('X-Total-Count', count);
|
||||
|
||||
res.status(200).json({
|
||||
|
||||
Reference in New Issue
Block a user