From c731d7f918ce96cea1a7c60c0de767b54f189a55 Mon Sep 17 00:00:00 2001 From: Nick Hellemans Date: Thu, 20 Jun 2024 16:53:08 +0200 Subject: [PATCH] feat(): return meds data as string (#245) --- .../actions/CollectMedication/CollectMedication.tsx | 2 +- .../CollectMedication/hooks/useCollectMedication.tsx | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/components/Extension/CollectDataExtension/actions/CollectMedication/CollectMedication.tsx b/src/components/Extension/CollectDataExtension/actions/CollectMedication/CollectMedication.tsx index be1b539a..f24d6298 100644 --- a/src/components/Extension/CollectDataExtension/actions/CollectMedication/CollectMedication.tsx +++ b/src/components/Extension/CollectDataExtension/actions/CollectMedication/CollectMedication.tsx @@ -29,7 +29,7 @@ export const CollectMedication: FC = ({ (medications) => { onSubmit({ activityId: activity_id, - medicationDataAsJson: JSON.stringify(medications), + medicationData: JSON.stringify(medications), }) }, [activity_id, onSubmit] diff --git a/src/components/Extension/CollectDataExtension/actions/CollectMedication/hooks/useCollectMedication.tsx b/src/components/Extension/CollectDataExtension/actions/CollectMedication/hooks/useCollectMedication.tsx index 716a9f4d..43cb36f4 100644 --- a/src/components/Extension/CollectDataExtension/actions/CollectMedication/hooks/useCollectMedication.tsx +++ b/src/components/Extension/CollectDataExtension/actions/CollectMedication/hooks/useCollectMedication.tsx @@ -7,13 +7,14 @@ export const useCollectMedication = () => { const onSubmit = useCallback( async ({ activityId, - medicationDataAsJson, + medicationData, }: { activityId: string - medicationDataAsJson: string + medicationData: string }) => { const dataPoints: DataPoints = [ - { key: 'medicationData', value: medicationDataAsJson }, + { key: 'medicationData', value: medicationData }, // JSON data point value type + { key: 'medicationDataString', value: medicationData }, // String data point value type ] return _onSubmit(activityId, dataPoints)