Skip to content

Commit

Permalink
Fix saving existing HydroTestResults (#1023)
Browse files Browse the repository at this point in the history
  • Loading branch information
tschumpr authored Feb 14, 2024
2 parents 123262b + 65af9c5 commit a581980
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/client/cypress/e2e/editor/hydrotest.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,12 @@ describe("Tests for the hydrotest editor.", () => {
evaluateDisplayValue("hydrotestResult.0.minValue", "5 m/s");
evaluateDisplayValue("hydrotestResult.0.maxValue", "15 m/s");

startEditing();
setInput("comment", "Lorem.");
saveForm();
cy.wait("@hydrotest_GET");
evaluateDisplayValue("comment", "Lorem.");

// delete hydrotest
deleteItem();
cy.wait("@hydrotest_GET");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,18 @@ const HydrotestInput = props => {
data.codelistIds = [...data.codelistIds, ...data.evaluationMethodId];
}

if (data.hydrotestResults) {
data.hydrotestResults = data.hydrotestResults.map(r => {
return {
id: r.id,
parameterId: r.parameterId,
value: r.value,
minValue: r.minValue,
maxValue: r.maxValue,
};
});
}

if (data.casingId == null) {
data.casingId = item.casingId;
}
Expand Down

0 comments on commit a581980

Please sign in to comment.