-
Notifications
You must be signed in to change notification settings - Fork 151
Open
Labels
enhancementNew feature or requestNew feature or request
Description
hello, on submit, if the tokens are valid, everything works correctly and Swal displays a message, if the token is not valid, a refresh fires, the form submit fires again, but Swal no longer displays a message. How to deal with it?
async onResponseError(ctx: FetchContext): Promise<any> {
if (ctx.response.status === 401) {
const { error } = await this.refreshToken();
if (!error) {
// eslint-disable-next-line no-return-await
return await this.fetcher(ctx.request, ctx.options);
}
}
}repository
async addProductToCart(body: any, filter: any = {}): Promise<any> {
return this.fetcher(this.urlGenerator.addProductToCart(), {
method: 'POST',
body,
params: filter
});
}my function
const onSubmit = handleSubmit(async () => {
const {
error,
pending
} = await useLazyAsyncData(
'updateUserProfile',
() => httpRepository.addProductToCart(form),
{
initialCache: false
}
);
isLoading.value = pending.value;
if (!error.value) {
Swal.fire({
toast: true,
position: 'top-right',
text: 'Данные успешно обновлены!',
icon: 'success',
timer: 3000,
showConfirmButton: false
});
}
});Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request