From abe405c1b551ad5ee9c5139b49192d85f3cae958 Mon Sep 17 00:00:00 2001 From: bill bittner Date: Mon, 30 Jul 2018 14:50:10 -0700 Subject: [PATCH] inserted check for xml requests --- server/controllers/api/oEmbed/index.js | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/server/controllers/api/oEmbed/index.js b/server/controllers/api/oEmbed/index.js index 9e005d8a..0c4b108a 100644 --- a/server/controllers/api/oEmbed/index.js +++ b/server/controllers/api/oEmbed/index.js @@ -50,11 +50,14 @@ const getOEmbedData = (req, res) => { if (isChannel && !paramTwo) { getOEmbedDataForChannel(channelName, channelClaimId) .then(data => { - return res.status(200).json({ - success: true, - message: 'hello', - data, - }); + if (format === 'xml'){ + return res.status(503).json({ + success: false, + message: 'xml format is not implemented yet', + }) + } else { + return res.status(200).json(data); + } }) .catch((error) => { return res.status(404).json({ @@ -66,11 +69,14 @@ const getOEmbedData = (req, res) => { } else { getOEmbedDataForAsset(channelName, channelClaimId, claimName, claimId) .then(data => { - return res.status(200).json({ - success: true, - message: 'hello', - data, - }); + if (format === 'xml'){ + return res.status(503).json({ + success: false, + message: 'xml format is not implemented yet', + }) + } else { + return res.status(200).json(data); + } }) .catch((error) => { return res.status(404).json({