diff --git a/rc_rewrite.js b/rc_rewrite.js index 47f0812..973573f 100644 --- a/rc_rewrite.js +++ b/rc_rewrite.js @@ -1,4 +1,4 @@ -const storageKeyName = "rc_rewrite_ddata"; +const storageKeyName = "rc_rewrite_data"; const jobTitle = "update_rc"; const notificationTitle = "Update RevenueCat JSON" @@ -7,7 +7,7 @@ let URL = ""; // URL = "https://stackoverflow.com/questions/38708550/difference-between-return-await-promise-and-return-promise" // URL = "http://localhost:8000/rc_rewrite_data.json"; // URL = "https://api.jsonbin.io/v3/qs/651be8b30574da7622b3b246"; -URL = "https://git.ykz.app/PorridgePi/json/raw/branch/main/rc_rewrite_data.json"; +URL = "https://git.ykz.app/PorridgePi/qx/raw/branch/main/rc_rewrite_data.json"; // URL = "https://porridgepi.github.io/json/rc_rewrite_data.json" requestOpts = { @@ -205,7 +205,7 @@ async function onResponse(context, url, request, response) { "purchase_date": "2020-01-01T00:00:00Z" } } - for (const i of rewriteItem.new_other_purchases) { + for (const i of rewriteItem.new_non_subscriptions) { body.subscriber.other_purchases[i] = { purchase_date: "2020-01-01T00:00:00Z" } @@ -225,7 +225,7 @@ async function onResponse(context, url, request, response) { response.statusCode = 200; response.statusPhrase = "OK"; response.headers["Content-Type"] = "application/json"; - console.log(response.body); + console.log(JSON.stringify(response.body)); break; } @@ -233,9 +233,6 @@ async function onResponse(context, url, request, response) { return response; } - -var $request, $response; - async function main() { console.log("Starting..."); if (isSurge || isQuanX) {