diff --git a/src/controllers/organization.controller.js b/src/controllers/organization.controller.js index 7ec3823f..a2cd5dad 100644 --- a/src/controllers/organization.controller.js +++ b/src/controllers/organization.controller.js @@ -385,7 +385,15 @@ export const getMetaData = async (req, res) => { where: { orgUid: req.query.orgUid }, }); - return res.json(JSON.parse(organization.metadata)); + const rawMetadata = JSON.parse(organization.metadata); + const cleanedMetadata = {}; + + for (const [key, value] of Object.entries(rawMetadata)) { + const newKey = key.startsWith('meta_') ? key.substring(5) : key; + cleanedMetadata[newKey] = value; + } + + return res.json(cleanedMetadata); } catch (error) { res.status(400).json({ message: 'Error getting metadata for organization',