Correction mise à jour jeton authentification
This commit is contained in:
@ -31,7 +31,7 @@ export const useGameStartMutation = ({ auth, updateGameState, onPostSuccess, onE
|
||||
}).then(resp => resp.json())
|
||||
},
|
||||
onSuccess: async (data) => {
|
||||
if (data.error) {
|
||||
if (data.statusCode) {
|
||||
if (onError)
|
||||
onError({ response: data })
|
||||
return
|
||||
@ -59,7 +59,7 @@ export const useGameStopMutation = ({ auth, updateGameState, onPostSuccess, onEr
|
||||
}).then(resp => resp.json())
|
||||
},
|
||||
onSuccess: async (data) => {
|
||||
if (data.error) {
|
||||
if (data.statusCode) {
|
||||
if (onError)
|
||||
onError({ response: data })
|
||||
return
|
||||
@ -87,7 +87,7 @@ export const useGameSwitchPlayerMutation = ({ auth, updateGameState, onPostSucce
|
||||
}).then(resp => resp.json())
|
||||
},
|
||||
onSuccess: async (data) => {
|
||||
if (data.error) {
|
||||
if (data.statusCode) {
|
||||
if (onError)
|
||||
onError({ response: data })
|
||||
return
|
||||
@ -115,7 +115,7 @@ export const useGameRepairMutation = ({ auth, onPostSuccess, onError }: GameProp
|
||||
}).then(resp => resp.json())
|
||||
},
|
||||
onSuccess: async (data) => {
|
||||
if (data.error) {
|
||||
if (data.statusCode) {
|
||||
if (onError)
|
||||
onError({ response: data })
|
||||
return
|
||||
@ -142,7 +142,7 @@ export const useGameResetMutation = ({ auth, updateGameState, onPostSuccess, onE
|
||||
}).then(resp => resp.json())
|
||||
},
|
||||
onSuccess: async (data) => {
|
||||
if (data.error) {
|
||||
if (data.statusCode) {
|
||||
if (onError)
|
||||
onError({ response: data })
|
||||
return
|
||||
|
@ -33,7 +33,7 @@ export const useLoginMutation = ({ authLogin, onPostSuccess, onError }: LoginPro
|
||||
},
|
||||
networkMode: 'always',
|
||||
onSuccess: async (data, { name, password }: LoginForm) => {
|
||||
if (data.error) {
|
||||
if (data.statusCode) {
|
||||
if (onError)
|
||||
onError({ response: data })
|
||||
return
|
||||
|
@ -33,7 +33,7 @@ export const useAddTrainMutation = ({ auth, onPostSuccess, onError }: TrainProps
|
||||
}).then(resp => resp.json())
|
||||
},
|
||||
onSuccess: async (data) => {
|
||||
if (data.error) {
|
||||
if (data.statusCode) {
|
||||
if (onError)
|
||||
onError({ response: data })
|
||||
return
|
||||
|
Reference in New Issue
Block a user