From 427e84de074253e21ba1208d7a79230852759ef6 Mon Sep 17 00:00:00 2001 From: Carlos Santos <4a.santos@gmail.com> Date: Fri, 11 Apr 2025 11:24:16 +0200 Subject: [PATCH] backend: Update getRooms response to include pagination details --- backend/src/controllers/room.controller.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/src/controllers/room.controller.ts b/backend/src/controllers/room.controller.ts index f5d5558..01a8f68 100644 --- a/backend/src/controllers/room.controller.ts +++ b/backend/src/controllers/room.controller.ts @@ -30,9 +30,9 @@ export const getRooms = async (req: Request, res: Response) => { logger.verbose('Getting all rooms'); try { - const response = await roomService.getAllMeetRooms(queryParams); - - return res.status(200).json(response); + const { rooms, isTruncated, nextPageToken } = await roomService.getAllMeetRooms(queryParams); + const maxItems = Number(queryParams.maxItems); + return res.status(200).json({ rooms, pagination: { isTruncated, nextPageToken, maxItems } }); } catch (error) { logger.error('Error getting rooms'); handleError(res, error);