diff --git a/package-lock.json b/package-lock.json index 30471cd2..2e698b0a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@bcgsc-pori/graphkb-client", - "version": "4.3.0", + "version": "4.3.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@bcgsc-pori/graphkb-client", - "version": "4.3.0", + "version": "4.3.1", "license": "GPL-3.0", "dependencies": { "@babel/plugin-transform-class-properties": "^7.23.3", diff --git a/package.json b/package.json index 9d5aa027..fe8ae167 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@bcgsc-pori/graphkb-client", - "version": "4.3.0", + "version": "4.3.1", "private": true, "bugs": { "email": "graphkb@bcgsc.ca" diff --git a/src/components/VariantForm/index.tsx b/src/components/VariantForm/index.tsx index 172af86e..a3f6e2e6 100644 --- a/src/components/VariantForm/index.tsx +++ b/src/components/VariantForm/index.tsx @@ -156,7 +156,7 @@ const VariantForm = ({ /* KBDEV-1216 Adding refAA to break1Start property when new variant has ProteinPosition coordinate system. Property has the same value as refSeq and should be hidden from users to avoid confusion. */ - if (payload?.break1Start['@class'] === 'ProteinPosition') { + if (payload?.break1Start && payload?.break1Start['@class'] === 'ProteinPosition') { const refAA = payload.refSeq ? payload.refSeq : ''; payload.break1Start = { ...payload.break1Start, refAA }; } @@ -167,10 +167,13 @@ const VariantForm = ({ : 'edited'; try { - const result = await formVariant === FORM_VARIANT.NEW - ? api.post(routeName, payload) - : api.patch(`${routeName}/${content['@rid'].replace(/^#/, '')}`, payload); + let result; + if (formVariant === FORM_VARIANT.NEW) { + result = await api.post(routeName, payload); + } else { + result = await api.patch(`${routeName}/${content['@rid'].replace(/^#/, '')}`, payload); + } snackbar.enqueueSnackbar(`Sucessfully ${actionType} the record ${result['@rid']}`, { variant: 'success' }); onSubmit(result); } catch (err) {