mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-12 05:17:28 -08:00
fix(core): Use trx manager instead of repository for tags overwrite (#8557)
This commit is contained in:
parent
c4e39451db
commit
abddbb6227
|
@ -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);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue