From a28c08f8b2e768a03c60ff814be95ea088eb39a1 Mon Sep 17 00:00:00 2001 From: asif Date: Mon, 10 Nov 2025 12:20:04 +0530 Subject: [PATCH] fix: set tnc accepted api --- src/controllers/auth.controller.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/controllers/auth.controller.js b/src/controllers/auth.controller.js index 2c0c88f..6b80029 100644 --- a/src/controllers/auth.controller.js +++ b/src/controllers/auth.controller.js @@ -372,9 +372,10 @@ async function getTncAcceptanceFlag(req, res) { async function setTncAcceptanceFlag(req, res) { try { const { flag } = req.body; - if (typeof flag !== 'boolean') - res.staus(400).json({ error: 'invalid value for flag' }); + if (flag !== 'Y' && flag !== 'N') + res.status(400).json({ error: 'invalid value for flag' }); await authService.setTncFlag(req.user, req.client, flag); + return res.json({ message: 'SUCCESS' }); } catch (error) { logger.error(error, 'error occured while updating tnc flag'); res.status(500).json({ error: 'INTERNAL SERVER ERROR' });