Support referencing updatedFields array in databaseEvent triggers (#17240)
Closes https://github.com/twentyhq/core-team-issues/issues/1838 DatabaseEventTriggers can now define a field-level granularity on which updates they should react to. After a discussion with the team, we have decided to rely on field names and not UID, just as we do for objects. The rationale is that we want to keep a pleasant devX and consider it's not on twenty to ensure continuity of api usage around an object if their name is updated: for instance if a user has based their webhook on the name of an object, if they decide to update it, they have to take care of updating their webhook.
This commit is contained in:
@@ -1115,6 +1115,7 @@ export class ApplicationSyncService {
|
||||
update: {
|
||||
settings: {
|
||||
eventName: triggerToSync.eventName,
|
||||
updatedFields: triggerToSync.updatedFields,
|
||||
},
|
||||
},
|
||||
};
|
||||
@@ -1133,6 +1134,7 @@ export class ApplicationSyncService {
|
||||
const createDatabaseEventTriggerInput = {
|
||||
settings: {
|
||||
eventName: triggerToCreate.eventName,
|
||||
updatedFields: triggerToCreate.updatedFields,
|
||||
},
|
||||
universalIdentifier: triggerToCreate.universalIdentifier,
|
||||
serverlessFunctionId,
|
||||
|
||||
Reference in New Issue
Block a user