fix: do not resend the request if it is not necessary
All checks were successful
Build and Deploy Angular App / build (push) Successful in 1m20s
All checks were successful
Build and Deploy Angular App / build (push) Successful in 1m20s
Signed-off-by: Polianin Nikita <wesser@noreply.git.winsomnia.net>
This commit is contained in:
parent
90fca336f5
commit
a8b1485b0e
@ -68,7 +68,7 @@ export default abstract class ApiService {
|
|||||||
body: request.data,
|
body: request.data,
|
||||||
}).pipe(
|
}).pipe(
|
||||||
catchError(error => {
|
catchError(error => {
|
||||||
if (!secondTry && error.status === 401)
|
if (request.needAuth && !secondTry && error.status === 401)
|
||||||
return this.handle401Error(error).pipe(
|
return this.handle401Error(error).pipe(
|
||||||
switchMap(() => this.sendHttpRequest<Type>(method, request, true))
|
switchMap(() => this.sendHttpRequest<Type>(method, request, true))
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user