File tree 1 file changed +3
-4
lines changed
src/client/app/api/queries
1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -102,10 +102,9 @@ export const usePlukkOppgaveMutation = (callback?: (oppgave: ReservasjonV3FraKø
102
102
return useMutation ( {
103
103
mutationFn : ( data : { oppgaveKøId : string } ) : Promise < ReservasjonV3FraKøDto [ ] > =>
104
104
axiosInstance . post ( `${ apiPaths . hentOppgaveFraKoV3 ( data . oppgaveKøId ) } ` , data ) . then ( ( response ) => response . data ) ,
105
- onSuccess : async ( data : ReservasjonV3FraKøDto [ ] | ReservasjonV3FraKøDto ) => {
106
- const array = Array . isArray ( data ) ? data : [ data ] ; // Midlertidig, for å slippe å deploye backend og frontend helt samtidig
107
- if ( callback ) callback ( array ) ;
108
- if ( array . length > 0 ) {
105
+ onSuccess : async ( data : ReservasjonV3FraKøDto [ ] ) => {
106
+ if ( callback ) callback ( data ) ;
107
+ if ( data . length > 0 ) {
109
108
await queryClient . refetchQueries ( { queryKey : [ apiPaths . saksbehandlerReservasjoner ] } ) ;
110
109
}
111
110
} ,
You can’t perform that action at this time.
0 commit comments