We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ae92cd5 commit ef11835Copy full SHA for ef11835
apps/web/src/hooks/useInstrumentRecords.ts
@@ -1,3 +1,4 @@
1
+import { reviver } from '@douglasneuroinformatics/libjs';
2
import { $InstrumentRecord } from '@opendatacapture/schemas/instrument-records';
3
import type { InstrumentRecordQueryParams } from '@opendatacapture/schemas/instrument-records';
4
import { useQuery } from '@tanstack/react-query';
@@ -18,7 +19,8 @@ export const useInstrumentRecords = (
18
19
enabled,
20
queryFn: async () => {
21
const response = await axios.get('/v1/instrument-records', {
- params
22
+ params,
23
+ transformResponse: [(data: string) => JSON.parse(data, reviver) as unknown]
24
});
25
return $InstrumentRecord.array().parseAsync(response.data);
26
},
0 commit comments