Skip to content

Commit

Permalink
Change response format from JSON to string
Browse files Browse the repository at this point in the history
  • Loading branch information
versun committed Aug 29, 2023
1 parent bac0427 commit 3b90a04
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,17 +79,18 @@ async function create(event) {
console.log(payload);
loading.style.display = 'block';
const promise = await functions.createExecution('rss_action', JSON.stringify(payload));
let res = promise.response.replace(/\\\\/g, "\\");
res = JSON.parse(res);
let translated_feed_url = res.t_feed_url || null;
let translated_feed_url = promise.response//.replace(/\\\\/g, "\\");
//res = JSON.parse(res);
//let translated_feed_url = res.t_feed_url || null;

if (translated_feed_url) {
if (translated_feed_url!='error') {
result.style.display = 'block';
t_feed_url.value = translated_feed_url;
url.value = null;
} else {
result.style.display = 'none';
throw new Error(JSON.stringify(res));
//throw new Error(JSON.stringify(res));
throw new Error('Error, Please check the URL and try again')
}

} catch (error) {
Expand Down

0 comments on commit 3b90a04

Please sign in to comment.