fix(core): Fix workflow tagging failure due to unique constraint check (#8505)
This commit is contained in:
@@ -7,4 +7,14 @@ export class WorkflowTagMappingRepository extends Repository<WorkflowTagMapping>
|
||||
constructor(dataSource: DataSource) {
|
||||
super(WorkflowTagMapping, dataSource.manager);
|
||||
}
|
||||
|
||||
async overwriteTaggings(workflowId: string, tagIds: string[]) {
|
||||
return await this.manager.transaction(async () => {
|
||||
await this.delete({ workflowId });
|
||||
|
||||
const taggings = tagIds.map((tagId) => this.create({ workflowId, tagId }));
|
||||
|
||||
return await this.insert(taggings);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user