File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
apps/web/src/features/upload/hooks Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -9,8 +9,13 @@ export function useUploadInstrumentRecords() {
99 const addNotification = useNotificationsStore ( ( store ) => store . addNotification ) ;
1010 return useMutation ( {
1111 mutationFn : async ( data : UploadInstrumentRecordsData ) => {
12- const replacedData = JSON . parse ( JSON . stringify ( data , replacer ) ) as Json ;
13- await axios . post ( '/v1/instrument-records/upload' , replacedData ) ;
12+ await axios . post ( '/v1/instrument-records/upload' , {
13+ ...data ,
14+ records : data . records . map ( ( record ) => ( {
15+ ...record ,
16+ data : JSON . parse ( JSON . stringify ( record . data , replacer ) ) as Json
17+ } ) )
18+ } satisfies UploadInstrumentRecordsData ) ;
1419 } ,
1520 onSuccess ( ) {
1621 addNotification ( { type : 'success' } ) ;
You can’t perform that action at this time.
0 commit comments