Téléchargmeent des mises à jour de solde

This commit is contained in:
2024-12-13 23:07:37 +01:00
parent 4a33963c12
commit 02304527d3
7 changed files with 82 additions and 4 deletions

View File

@ -40,6 +40,11 @@ export const useGeolocationMutation = ({ auth, onPostSuccess, onError }: PostPro
},
networkMode: 'offlineFirst',
onSuccess: async (data, location: LocationObject, context: unknown) => {
if (data.statusCode) {
if (onError)
onError({ response: data })
return
}
if (onPostSuccess)
onPostSuccess(data, location, context)
},

View File

@ -0,0 +1,8 @@
import { useAppDispatch, useAppSelector } from "./useStore"
import { downloadMoneyUpdates, MoneyUpdatesPayload } from "@/utils/features/moneyUpdates/moneyUpdatesSlice"
export const useMoneyUpdates = () => useAppSelector((state) => state.moneyUpdates.moneyUpdates)
export const useDownloadMoneyUpdates = () => {
const dispath = useAppDispatch()
return (moneyUpdatesData: MoneyUpdatesPayload) => dispath(downloadMoneyUpdates(moneyUpdatesData))
}