Skip to content

Commit 999b78d

Browse files
committed
- Conditionally check for 'flags' property in req body to avoid undefined error
1 parent 19e797f commit 999b78d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

app/routes/report/variants.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ router.route('/set-summary-table/')
548548
if (!annotationMatch) {
549549
const newAnnotation = {...(annotation.annotations || {})};
550550
newAnnotation.rapidReportTableTag = req.body.rapidTable;
551-
const newFlags = req.body.flags;
551+
const newFlags = req.body.flags ?? null;
552552
try {
553553
await db.models.observedVariantAnnotations.update({
554554
annotations: newAnnotation,
@@ -568,7 +568,7 @@ router.route('/set-summary-table/')
568568
variantId: req.body.variantId,
569569
variantType: req.body.variantType,
570570
annotations: {rapidReportTableTag: req.body.rapidTable},
571-
flags: req.body.flags,
571+
flags: req.body.flags ?? null,
572572
reportId: req.report.id,
573573
});
574574
} catch (error) {

0 commit comments

Comments
 (0)