fix: api service

This commit is contained in:
Sergey Yarkov 2021-08-19 23:45:23 +03:00
parent 4fd3d65903
commit 05b79a0875
2 changed files with 4 additions and 9 deletions

View File

@ -6,9 +6,12 @@ export default class ApiService {
public api: AxiosInstance; public api: AxiosInstance;
public config: AxiosRequestConfig | undefined;
constructor(root: RootStore, config?: AxiosRequestConfig | undefined) { constructor(root: RootStore, config?: AxiosRequestConfig | undefined) {
this.root = root; this.root = root;
this.api = axios.create(config); this.config = config;
this.api = axios.create(this.config);
this.setupInterceptors(); this.setupInterceptors();
} }
@ -29,8 +32,4 @@ export default class ApiService {
return Promise.reject(error); return Promise.reject(error);
}); });
} }
get config(): AxiosRequestConfig | undefined {
return this.config;
}
} }

View File

@ -14,10 +14,6 @@ export default class AuthStore {
makeAutoObservable(this); makeAutoObservable(this);
} }
get getToken(): string | null {
return this.token;
}
public setIsLoggedIn(value: boolean) { public setIsLoggedIn(value: boolean) {
Cookies.remove('logged_in'); Cookies.remove('logged_in');
this.isLoggedIn = value; this.isLoggedIn = value;