Skip to content

Commit

Permalink
Fix update event webhook triggering (twentyhq#7814)
Browse files Browse the repository at this point in the history
  • Loading branch information
martmull authored Oct 18, 2024
1 parent f6c094a commit 0c24001
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -361,19 +361,21 @@ export class GraphqlQueryRunnerService {
authContext.workspace.id,
);

const resultWithGettersArray = Array.isArray(resultWithGetters)
? resultWithGetters
: [resultWithGetters];

await this.workspaceQueryHookService.executePostQueryHooks(
authContext,
objectMetadataItem.nameSingular,
operationName,
Array.isArray(resultWithGetters)
? resultWithGetters
: [resultWithGetters],
resultWithGettersArray,
);

const jobOperation = this.operationNameToJobOperation(operationName);

if (jobOperation) {
await this.triggerWebhooks(resultWithGetters, jobOperation, options);
await this.triggerWebhooks(resultWithGettersArray, jobOperation, options);
}

return resultWithGetters;
Expand Down

0 comments on commit 0c24001

Please sign in to comment.