@kelbyone/services
Advanced tools
Comparing version 0.0.8 to 0.0.9
{ | ||
"name": "@kelbyone/services", | ||
"version": "0.0.8", | ||
"version": "0.0.9", | ||
"description": "KelbyOne Services", | ||
@@ -23,2 +23,2 @@ "main": "src/_services.js", | ||
"homepage": "https://github.com/curthusting/-kelbyone-services#readme" | ||
} | ||
} |
@@ -53,22 +53,22 @@ /** | ||
} | ||
try { | ||
const response = await send(url, 'POST', headers, JSON.stringify(body)); | ||
const data = await response.json(); | ||
// try { | ||
const response = await send(url, 'POST', headers, JSON.stringify(body)); | ||
const data = await response.json(); | ||
if (data.data.redirect && data.data.redirect.url) return window.location.replace(data.data.redirect.url); | ||
if (data.data.redirect && data.data.redirect.url) return window.location.replace(data.data.redirect.url); | ||
if ((response.status !== 200 && response.status !== 201) || response.success === false) { | ||
return { | ||
status: 'error', | ||
data: data.data, | ||
}; | ||
} | ||
if ((response.status !== 200 && response.status !== 201) || response.success === false) { | ||
return { | ||
status: 'success', | ||
status: 'error', | ||
data: data.data, | ||
}; | ||
} | ||
return { | ||
status: 'success', | ||
data: data.data, | ||
}; | ||
} catch (error) { | ||
throw new Error('Unable to send POST request', error) | ||
} | ||
// } catch (error) { | ||
// throw new Error('Unable to send POST request', error) | ||
// } | ||
}, | ||
@@ -75,0 +75,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5516