@openmrs/esm-patient-common-lib 11.3.1-pre.9455 → 11.3.1-pre.9462
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { restBaseUrl } from '@openmrs/esm-framework';
|
|
2
1
|
import { useCallback } from 'react';
|
|
3
2
|
import { useSWRConfig } from 'swr';
|
|
3
|
+
import { restBaseUrl } from '@openmrs/esm-framework';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Returns a function which refreshes the patient orders cache. Uses SWR's mutate function.
|
package/src/orders/useOrders.ts
CHANGED
|
@@ -36,8 +36,12 @@ export function usePatientOrders(
|
|
|
36
36
|
|
|
37
37
|
const mutateOrders = useCallback(
|
|
38
38
|
() =>
|
|
39
|
-
mutate(
|
|
40
|
-
|
|
39
|
+
mutate(
|
|
40
|
+
(key) => typeof key === 'string' && key.startsWith(`${restBaseUrl}/order?patient=${patientUuid}`),
|
|
41
|
+
undefined,
|
|
42
|
+
{ revalidate: true },
|
|
43
|
+
),
|
|
44
|
+
[mutate, patientUuid],
|
|
41
45
|
);
|
|
42
46
|
|
|
43
47
|
const orders = useMemo(
|