Skip to content

Commit

Permalink
fixes after merge
Browse files Browse the repository at this point in the history
  • Loading branch information
bosiraphael committed Aug 19, 2024
1 parent a340ea2 commit 0366683
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ export class EntityEventsToDbListener {
}

@OnEvent('*.deleted')
async handleDelete(payload: ObjectRecordUpdateEvent<any>) {
async handleDelete(
payload: WorkspaceEventBatch<ObjectRecordUpdateEvent<any>>,
) {
return this.handle(payload);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -761,18 +761,21 @@ export class WorkspaceQueryRunnerService {
options,
);

parsedResults.forEach((record) => {
this.eventEmitter.emit(`${objectMetadataItem.nameSingular}.created`, {
name: `${objectMetadataItem.nameSingular}.created`,
workspaceId: authContext.workspace.id,
userId: authContext.user?.id,
recordId: record.id,
objectMetadata: objectMetadataItem,
properties: {
after: this.removeNestedProperties(record),
},
} satisfies ObjectRecordCreateEvent<any>);
});
this.workspaceEventEmitter.emit(
`${objectMetadataItem.nameSingular}.created`,
parsedResults.map(
(record) =>
({
userId: authContext.user?.id,
recordId: record.id,
objectMetadata: objectMetadataItem,
properties: {
after: this.removeNestedProperties(record),
},
}) satisfies ObjectRecordCreateEvent<any>,
),
authContext.workspace.id,
);

return parsedResults;
}
Expand Down

0 comments on commit 0366683

Please sign in to comment.