From 41bbc9302ecba745d982e2942391f9a1b90c3b69 Mon Sep 17 00:00:00 2001 From: "Josepablo C." Date: Thu, 16 Nov 2023 19:18:51 -0600 Subject: [PATCH] feat: Adding categories to public-vehicles/location --- src/apps/public/public-vehicles/services.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/apps/public/public-vehicles/services.js b/src/apps/public/public-vehicles/services.js index 31d89d8..71611aa 100644 --- a/src/apps/public/public-vehicles/services.js +++ b/src/apps/public/public-vehicles/services.js @@ -42,7 +42,8 @@ const getListLocations = async(req, res) => { "last_location_geo", "driver", "updatedAt", - "status" + "status", + "categories" ]; const { elements } = getPagination( req.query ); const page = 0;// No pagination allowed to this endpoint @@ -55,7 +56,7 @@ const getListLocations = async(req, res) => { const objQuery = await generic.getListQuery( page , query_elements, filter, select ); - const data = await objQuery.query.sort("field -updatedAt").exec(); + const data = await objQuery.query.sort("field -updatedAt").populate("categories").exec(); const retVal = { total : objQuery.total,