From 52f77d30bed44de0d7227d6dbeae86168542c7bb Mon Sep 17 00:00:00 2001 From: Jamie Arodi <51090527+arodidev@users.noreply.github.com> Date: Wed, 15 May 2024 13:29:50 +0300 Subject: [PATCH] (fix) return encounter type uuid from encounter type object (#1836) return uuid from encounter type object --- packages/esm-form-engine-app/src/hooks/useFormSchema.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/esm-form-engine-app/src/hooks/useFormSchema.tsx b/packages/esm-form-engine-app/src/hooks/useFormSchema.tsx index 1af3bbbf5c..31f1ce204a 100644 --- a/packages/esm-form-engine-app/src/hooks/useFormSchema.tsx +++ b/packages/esm-form-engine-app/src/hooks/useFormSchema.tsx @@ -14,7 +14,9 @@ const useFormSchema = (formUuid: string) => { const { data, error, isLoading } = useSWR<{ data: FormSchema }>(url, openmrsFetch); - return { schema: data?.data, error, isLoading }; + const schema = { ...data?.data, encounterType: data?.data.encounterType['uuid'] }; + + return { schema, error, isLoading }; }; export default useFormSchema;