Skip to content

Commit ccbec84

Browse files
author
Anna Davies
committed
Merge pull request #632 in DAT/ipr-client from release/v5.0.3 to master
* commit '09c8c1ec69ec2aef349df5759ba1b9c63896b8aa': 5.0.3 Fix microbial update endpoint
2 parents cca6a2e + 09c8c1e commit ccbec84

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

app/views/ReportView/components/GenomicSummary/index.jsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,11 @@ const GenomicSummary = (props) => {
350350
}
351351

352352
if (newMicrobialData) {
353-
apiCalls.push(api.put(`/reports/${report.ident}/microbial`, newMicrobialData));
353+
if (microbialData && microbialData.length) {
354+
apiCalls.push(api.put(`/reports/${report.ident}/summary/microbial/${microbialData[0].ident}`, newMicrobialData));
355+
} else {
356+
apiCalls.push(api.post(`/reports/${report.ident}/summary/microbial`, newMicrobialData));
357+
}
354358
setMicrobialData(newMicrobialData);
355359
} else {
356360
apiCalls.push({ request: () => null });
@@ -378,8 +382,8 @@ const GenomicSummary = (props) => {
378382
}
379383

380384
let microbialUpdateData;
381-
if (newMicrobialData && newMicrobialData.length) {
382-
microbialUpdateData = newMicrobialData[0].species;
385+
if (newMicrobialData) {
386+
microbialUpdateData = newMicrobialData.species;
383387
} else if (microbialData && microbialData.length) {
384388
microbialUpdateData = microbialData[0].species;
385389
} else {
@@ -455,7 +459,7 @@ const GenomicSummary = (props) => {
455459
value: null,
456460
},
457461
]);
458-
}, [report, isSigned, history, microbialData, primaryBurdenData, print, setReport, signatureData]);
462+
}, [isSigned, microbialData, primaryBurdenData, report, print, signatureData, primaryComparator, setReport, history]);
459463

460464
return (
461465
<div className="genomic-summary">

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"private": true,
33
"name": "ipr-client",
4-
"version": "5.0.2",
4+
"version": "5.0.3",
55
"keywords": [],
66
"license": "GPL-3.0",
77
"sideEffects": false,

0 commit comments

Comments
 (0)