Skip to content

Commit

Permalink
fixed the endpoints with the updated values
Browse files Browse the repository at this point in the history
  • Loading branch information
SeriousHorncat committed Oct 23, 2023
1 parent 7969bab commit 872e8b9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
13 changes: 9 additions & 4 deletions frontend/src/views/AnalysisView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,8 @@ export default {
const updatedFieldIndex = updatedSection.content.findIndex((row) => {
return row.field == field;
});
updatedSection.content.splice(updatedFieldIndex, 1, updatedAnalysisSectionField.field_value);
updatedSection.content.splice(updatedFieldIndex, 1, updatedAnalysisSectionField.updated_row);
this.replaceAnalysisSection(updatedSection);
} catch (error) {
console.error('Updating the analysis did not work');
Expand All @@ -554,8 +555,6 @@ export default {
.cancelText('Cancel')
.confirm(`Removing '${attachment.name}' from ${field} in ${section}?`);
console.log(attachment);
if (!confirmedDelete) {
return;
}
Expand Down Expand Up @@ -584,11 +583,17 @@ export default {
return sectionToFind.header == section;
});
const fieldToUpdate = updatedSection.content.find((row) => {
return row.field == field;
});
const updatedFieldIndex = updatedSection.content.findIndex((row) => {
return row.field == field;
});
updatedSection.content.splice(updatedFieldIndex, 1, updatedAnalysisSectionField.field_value);
fieldToUpdate.value = []

Check failure on line 594 in frontend/src/views/AnalysisView.vue

View workflow job for this annotation

GitHub Actions / nodejs-ci (20.8)

Missing semicolon
updatedSection.content.splice(updatedFieldIndex, 1, fieldToUpdate);
this.replaceAnalysisSection(updatedSection);
} catch (error) {
await notificationDialog.title('Failure').confirmText('Ok').alert(error);
Expand Down
7 changes: 1 addition & 6 deletions frontend/test/views/AnalysisView.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ describe('AnalysisView', () => {
mockedAttachSectionSupportingEvidence.returns({
header: 'Mus_musculus (Mouse) Model System',
field: 'Veterinary Pathology Imaging',
field_value: {
updated_row: {
type: 'section-supporting-evidence',
field: 'Veterinary Pathology Imaging',
value: [{
Expand Down Expand Up @@ -609,11 +609,6 @@ describe('AnalysisView', () => {
mockedRemoveSectionSupportingEvidenceFile.resolves({
header: 'Mus_musculus (Mouse) Model System',
field: 'Veterinary Histology Report',
field_value: {
type: 'section-supporting-evidence',
field: 'Veterinary Histology Report',
value: [],
},
});

const mouseSection = wrapper.getComponent('[id=Mus_musculus (Mouse) Model System]');
Expand Down

0 comments on commit 872e8b9

Please sign in to comment.