fix(core): Use trx manager instead of repository for tags overwrite (#8557)
This commit is contained in:
@@ -9,12 +9,12 @@ export class WorkflowTagMappingRepository extends Repository<WorkflowTagMapping>
|
|||||||
}
|
}
|
||||||
|
|
||||||
async overwriteTaggings(workflowId: string, tagIds: string[]) {
|
async overwriteTaggings(workflowId: string, tagIds: string[]) {
|
||||||
return await this.manager.transaction(async () => {
|
return await this.manager.transaction(async (tx) => {
|
||||||
await this.delete({ workflowId });
|
await tx.delete(WorkflowTagMapping, { workflowId });
|
||||||
|
|
||||||
const taggings = tagIds.map((tagId) => this.create({ workflowId, tagId }));
|
const taggings = tagIds.map((tagId) => this.create({ workflowId, tagId }));
|
||||||
|
|
||||||
return await this.insert(taggings);
|
return await tx.insert(WorkflowTagMapping, taggings);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user