Skip to content

Commit

Permalink
Send cluster reachability information in JSON object and not in JSON …
Browse files Browse the repository at this point in the history
…string
  • Loading branch information
ydahal1 committed Dec 5, 2024
1 parent bb9e8d9 commit 6113100
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Tombolo/server/controllers/clusterController.js
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,14 @@ const getClusters = async (req, res) => {
},
order: [["name", "ASC"]],
});
res.status(200).json({ success: true, data: clusters });
// Parse the JSON string into a JavaScript object
const parsedClusters = clusters.map((cluster) => {
const clusterData = cluster.get({ plain: true });
clusterData.reachabilityInfo = JSON.parse(clusterData.reachabilityInfo);
return clusterData;
});

res.status(200).json({ success: true, data: parsedClusters });
} catch (err) {
logger.error(`Get clusters: ${err.message}`);
res
Expand Down

0 comments on commit 6113100

Please sign in to comment.