Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions lib/metadataTypes/Script.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,22 @@ class Script extends MetadataType {
return super.updateREST(script, '/automation/v1/scripts/' + script.ssjsActivityId);
}

/**
* helper for {@link MetadataType.updateREST} and {@link MetadataType.updateSOAP}
*
* @param {MetadataTypeItem} metadataEntry a single metadata Entry
* @param {object} apiResponse varies depending on the API call
* @returns {Promise.<object>} apiResponse, potentially modified
*/
static async postUpdateTasks(metadataEntry, apiResponse) {
// script update endpoint returns wrong values for createdDate and modifiedDate - need to re-retrieve to get correct values
const ssjsActivityId = apiResponse?.ssjsActivityId;
if (ssjsActivityId) {
apiResponse = await this.client.rest.get('/automation/v1/scripts/' + ssjsActivityId);
}
return apiResponse;
}

/**
* Creates a single Script
*
Expand Down
Loading