Skip to content

Commit

Permalink
update: useApexREST(), build script chmod +x
Browse files Browse the repository at this point in the history
  • Loading branch information
ttntm committed Oct 22, 2023
1 parent 0badf67 commit 012da29
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
Empty file modified build.sh
100644 → 100755
Empty file.
13 changes: 8 additions & 5 deletions src/useApexREST.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,17 @@
*/
function useApexREST(config) {
if (!config.auth || !config.endpoint || !config.payload || typeof config.payload !== 'object') {
throw 'useApexREST: invalid configuration object'
return {
apx_status: 'Error',
apx_message: 'useApexREST: invalid configuration object'
}
}

/**
* `Script.Util.HttpRequest` returns the response in a .NET (?) CLR format.
* This function makes the response usable for JS.
* @returns {object | undefined}
*/
* `Script.Util.HttpRequest` returns the response in a .NET (?) CLR format.
* This function makes the response usable for JS.
* @returns {object | undefined}
*/
function processResponse(res) {
if (!res || !res.content) {
return undefined
Expand Down
13 changes: 8 additions & 5 deletions utils_full.js
Original file line number Diff line number Diff line change
Expand Up @@ -440,14 +440,17 @@ function sfmcUtils() {
*/
function useApexREST(config) {
if (!config.auth || !config.endpoint || !config.payload || typeof config.payload !== 'object') {
throw 'useApexREST: invalid configuration object'
return {
apx_status: 'Error',
apx_message: 'useApexREST: invalid configuration object'
}
}

/**
* `Script.Util.HttpRequest` returns the response in a .NET (?) CLR format.
* This function makes the response usable for JS.
* @returns {object | undefined}
*/
* `Script.Util.HttpRequest` returns the response in a .NET (?) CLR format.
* This function makes the response usable for JS.
* @returns {object | undefined}
*/
function processResponse(res) {
if (!res || !res.content) {
return undefined
Expand Down

0 comments on commit 012da29

Please sign in to comment.