feat(core): reimplement blocking workflow updates on interim changes (#4446)

* 📘 Update request type

* 📘 Update FE types

*  Adjust store

*  Set received hash

*  Send and load hash

*  Make helper more flexible

* 🗃️ Add new field to entity

* 🚨 Add check to endpoint

* 🧪 Add tests

*  Add `forceSave` flag

* 🐛 Fix workflow update failing on new workflow

* 🧪 Add more tests

*  Move check to `updateWorkflow()`

*  Refactor to accommodate latest changes

* 🧪 Refactor tests to keep them passing

*  Improve syntax
This commit is contained in:
Iván Ovejero
2022-10-31 10:35:24 +01:00
committed by GitHub
parent 263e6f30da
commit 46905fd2cb
12 changed files with 394 additions and 44 deletions

View File

@@ -183,6 +183,7 @@ EEWorkflowController.patch(
'/:id(\\d+)',
ResponseHelper.send(async (req: WorkflowRequest.Update) => {
const { id: workflowId } = req.params;
const forceSave = req.query.forceSave === 'true';
const updateData = new WorkflowEntity();
const { tags, ...rest } = req.body;
@@ -193,6 +194,7 @@ EEWorkflowController.patch(
updateData,
workflowId,
tags,
forceSave,
);
const { id, ...remainder } = updatedWorkflow;