We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 9c26763 + cc2cdc4 commit 3dfd50bCopy full SHA for 3dfd50b
1 file changed
apps/web/src/features/upload/hooks/useUploadInstrumentRecords.ts
@@ -9,8 +9,13 @@ export function useUploadInstrumentRecords() {
9
const addNotification = useNotificationsStore((store) => store.addNotification);
10
return useMutation({
11
mutationFn: async (data: UploadInstrumentRecordsData) => {
12
- const replacedData = JSON.parse(JSON.stringify(data, replacer)) as Json;
13
- await axios.post('/v1/instrument-records/upload', replacedData);
+ await axios.post('/v1/instrument-records/upload', {
+ ...data,
14
+ records: data.records.map((record) => ({
15
+ ...record,
16
+ data: JSON.parse(JSON.stringify(record.data, replacer)) as Json
17
+ }))
18
+ } satisfies UploadInstrumentRecordsData);
19
},
20
onSuccess() {
21
addNotification({ type: 'success' });
0 commit comments