Skip to content

Commit

Permalink
#871: fix update-event
Browse files Browse the repository at this point in the history
now uses generic method instead of outdated fuelSDK custom logic
  • Loading branch information
JoernBerkefeld committed Apr 22, 2023
1 parent f2338f6 commit 867f143
Showing 1 changed file with 5 additions and 23 deletions.
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

0 comments on commit 867f143

Please sign in to comment.