Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#871: fix update for type event #872

Merged
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
28 changes: 5 additions & 23 deletions lib/metadataTypes/Event.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,29 +161,11 @@ class Event extends MetadataType {
* @returns {Promise} Promise
*/
static async update(metadataEntry) {
if (metadataEntry === null || metadataEntry === undefined) {
return null;
}
this.removeNotUpdateableFields(metadataEntry);
const options = {
uri: '/interaction/v1/EventDefinitions/' + metadataEntry.id,
json: metadataEntry,
headers: {},
};
try {
const response = await this.client.rest.put(options);
super.checkForErrors(response);
return response;
} catch (ex) {
Util.metadataLogger(
'error',
this.definition.type,
'updateREST',
ex,
metadataEntry.name
);
return null;
}
return super.updateREST(
metadataEntry,
'/interaction/v1/EventDefinitions/' + metadataEntry.id,
'put'
);
}

/**
Expand Down