-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Only request value code onPress, handle error * typo * Use standard retry text * Refactor to use mutation * Use mutateAsync instead of onSuccess
- Loading branch information
1 parent
50906de
commit f2669b2
Showing
4 changed files
with
53 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import {useMutation} from '@tanstack/react-query'; | ||
import {getValueCode} from '@atb/mobility/api/api'; | ||
import {useAuthState} from '@atb/auth'; | ||
|
||
export const useValueCodeMutation = (operatorId: string | undefined) => { | ||
const {userId} = useAuthState(); | ||
return useMutation({ | ||
mutationKey: ['mobilityValueCode', userId, operatorId], | ||
mutationFn: () => getValueCode(operatorId), | ||
}); | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters