From 1e2ee0f32172f24fff80358ac954bec62a105b11 Mon Sep 17 00:00:00 2001 From: shwtea <shwetagupta0711754@gmail.com> Date: Fri, 6 Sep 2024 12:08:55 +0530 Subject: [PATCH] some changes --- api/template/service.js | 2 +- swagger.yaml | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/api/template/service.js b/api/template/service.js index 1bcae56..e1ac2b1 100644 --- a/api/template/service.js +++ b/api/template/service.js @@ -60,7 +60,7 @@ const getParticularTemplate = async (page,platform) => { try { const template = await Template.findOne({ name: page,platform}).populate('widgets.widgetId'); if (!template) { - return res.status(404).json({ error: 'Template not found' }); + return { status: 404, message: 'Template not found'}; } return template; } catch (error) { diff --git a/swagger.yaml b/swagger.yaml index 63757fd..f85f05f 100644 --- a/swagger.yaml +++ b/swagger.yaml @@ -21,12 +21,13 @@ paths: schema: type: string description: The page for which template details are requested. - - in: path + - in: query # Add platform as a query parameter name: platform required: true schema: type: string - description: The platform for which template details are requested. + enum: ['web', 'mobile', 'both'] + description: The platform for which template details are requested (web, mobile, or both). responses: '200': description: Template retrieved successfully -- GitLab