Implemented the functionality to add a WL Action
This commit is contained in:
@@ -4,7 +4,7 @@ function createHttpBackgroundJson({
|
||||
environment
|
||||
}) {
|
||||
const { fetch } = environment;
|
||||
async function fetchJson(url, options, requestName, debugRequests = null) {
|
||||
async function fetchJson(url, options, requestName, debugRequests = null, { allowEmpty = false } = {}) {
|
||||
const startedAt = new Date();
|
||||
const debugEntry = createBackgroundDebugEntry(requestName, url, options, startedAt);
|
||||
let response;
|
||||
@@ -36,6 +36,7 @@ function createHttpBackgroundJson({
|
||||
}
|
||||
|
||||
try {
|
||||
if (allowEmpty && !responsePayload.text.trim()) return null;
|
||||
return parseJsonResponse(responsePayload.text, requestName);
|
||||
} catch (error) {
|
||||
error.httpStatus = response.status;
|
||||
|
||||
Reference in New Issue
Block a user