inserted check for xml requests
This commit is contained in:
parent
79109cce69
commit
abe405c1b5
1 changed files with 16 additions and 10 deletions
|
@ -50,11 +50,14 @@ const getOEmbedData = (req, res) => {
|
||||||
if (isChannel && !paramTwo) {
|
if (isChannel && !paramTwo) {
|
||||||
getOEmbedDataForChannel(channelName, channelClaimId)
|
getOEmbedDataForChannel(channelName, channelClaimId)
|
||||||
.then(data => {
|
.then(data => {
|
||||||
return res.status(200).json({
|
if (format === 'xml'){
|
||||||
success: true,
|
return res.status(503).json({
|
||||||
message: 'hello',
|
success: false,
|
||||||
data,
|
message: 'xml format is not implemented yet',
|
||||||
});
|
})
|
||||||
|
} else {
|
||||||
|
return res.status(200).json(data);
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
return res.status(404).json({
|
return res.status(404).json({
|
||||||
|
@ -66,11 +69,14 @@ const getOEmbedData = (req, res) => {
|
||||||
} else {
|
} else {
|
||||||
getOEmbedDataForAsset(channelName, channelClaimId, claimName, claimId)
|
getOEmbedDataForAsset(channelName, channelClaimId, claimName, claimId)
|
||||||
.then(data => {
|
.then(data => {
|
||||||
return res.status(200).json({
|
if (format === 'xml'){
|
||||||
success: true,
|
return res.status(503).json({
|
||||||
message: 'hello',
|
success: false,
|
||||||
data,
|
message: 'xml format is not implemented yet',
|
||||||
});
|
})
|
||||||
|
} else {
|
||||||
|
return res.status(200).json(data);
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
return res.status(404).json({
|
return res.status(404).json({
|
||||||
|
|
Loading…
Reference in a new issue