@researchdatabox/sails-hook-redbox-servicenow-catalog 0.0.13 → 0.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -161,8 +161,12 @@ var Services;
|
|
|
161
161
|
if (!_.isNull(snResponse)) {
|
|
162
162
|
if (snResponse.status == 200) {
|
|
163
163
|
const updateSource = snResponse.data;
|
|
164
|
+
updateSource.workspace = workspaceData;
|
|
164
165
|
workspaceData = this.runDataRemap(updateSource, workspaceData, this.getConfig('catalog.update_fields', options));
|
|
165
|
-
yield RecordsService.updateMeta(null, oid, workspaceData);
|
|
166
|
+
const updateResp = yield RecordsService.updateMeta(null, oid, workspaceData);
|
|
167
|
+
if (this.getConfig('returnWorkspaceUpdate', options)) {
|
|
168
|
+
response = updateResp;
|
|
169
|
+
}
|
|
166
170
|
}
|
|
167
171
|
else {
|
|
168
172
|
sails.log.error(`ServiceNowCatalog submit request failed for workspace OID: ${oid}, check server logs.`);
|
package/package.json
CHANGED
|
@@ -148,8 +148,13 @@ export module Services {
|
|
|
148
148
|
if (snResponse.status == 200) {
|
|
149
149
|
const updateSource = snResponse.data;
|
|
150
150
|
// perform any updates to the workspace record ...
|
|
151
|
+
updateSource.workspace = workspaceData;
|
|
151
152
|
workspaceData = this.runDataRemap(updateSource, workspaceData, this.getConfig('catalog.update_fields', options));
|
|
152
|
-
await RecordsService.updateMeta(null, oid, workspaceData);
|
|
153
|
+
const updateResp = await RecordsService.updateMeta(null, oid, workspaceData);
|
|
154
|
+
// As of writing, the `response` object holds the state of the `addWorkspaceToRecord` call. For backwards-compat adding an attribute to return the workspace update instead
|
|
155
|
+
if (this.getConfig('returnWorkspaceUpdate', options)) {
|
|
156
|
+
response = updateResp;
|
|
157
|
+
}
|
|
153
158
|
} else {
|
|
154
159
|
sails.log.error(`ServiceNowCatalog submit request failed for workspace OID: ${oid}, check server logs.`);
|
|
155
160
|
sails.log.error(JSON.stringify(snResponse));
|