Skip to content

Commit

Permalink
fix(core): Use trx manager instead of repository for tags overwrite
Browse files Browse the repository at this point in the history
  • Loading branch information
ivov committed Feb 6, 2024
1 parent 28aee7c commit eca52fd
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ export class WorkflowTagMappingRepository extends Repository<WorkflowTagMapping>
}

async overwriteTaggings(workflowId: string, tagIds: string[]) {
return await this.manager.transaction(async () => {
await this.delete({ workflowId });
return await this.manager.transaction(async (tx) => {
await tx.delete(WorkflowTagMapping, { workflowId });

const taggings = tagIds.map((tagId) => this.create({ workflowId, tagId }));

return await this.insert(taggings);
return await tx.insert(WorkflowTagMapping, taggings);
});
}
}

0 comments on commit eca52fd

Please sign in to comment.