mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-24 04:04:06 -08:00
🐛 only update tags if set in request (#1900)
* only update tags if set in request * only create relations/sort if tags exist
This commit is contained in:
parent
44c3e97621
commit
0b65459f9f
|
@ -673,10 +673,13 @@ class App {
|
||||||
await WorkflowHelpers.validateWorkflow(updateData);
|
await WorkflowHelpers.validateWorkflow(updateData);
|
||||||
await Db.collections.Workflow!.update(id, updateData).catch(WorkflowHelpers.throwDuplicateEntryError);
|
await Db.collections.Workflow!.update(id, updateData).catch(WorkflowHelpers.throwDuplicateEntryError);
|
||||||
|
|
||||||
const tablePrefix = config.get('database.tablePrefix');
|
if (tags) {
|
||||||
await TagHelpers.removeRelations(req.params.id, tablePrefix);
|
const tablePrefix = config.get('database.tablePrefix');
|
||||||
if (tags?.length) {
|
await TagHelpers.removeRelations(req.params.id, tablePrefix);
|
||||||
await TagHelpers.createRelations(req.params.id, tags, tablePrefix);
|
|
||||||
|
if (tags.length) {
|
||||||
|
await TagHelpers.createRelations(req.params.id, tags, tablePrefix);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// We sadly get nothing back from "update". Neither if it updated a record
|
// We sadly get nothing back from "update". Neither if it updated a record
|
||||||
|
|
Loading…
Reference in a new issue