remove loader service to fix api calls

This commit is contained in:
Tykayn 2021-05-20 14:49:37 +02:00 committed by tykayn
parent 597bde003f
commit e66ca4448b

View File

@ -96,13 +96,12 @@ export class ApiService {
console.log('Error', error.message);
}
console.log(error.config);
this.loaderService.setStatus(false);
// this.loaderService.setStatus(false);
}
public async createPoll(poll: Poll): Promise<Subscription> {
// this.loaderService.setStatus(true);
console.log('createPoll config', poll);
this.loaderService.setStatus(true);
return this.axiosInstance.post(
`${this.baseHref}${currentApiRoutes['api_new_poll']}`,
poll,
@ -295,17 +294,18 @@ export class ApiService {
ApiService.handleError(error);
}
}
/////////////////////
// PRIVATE METHODS //
/////////////////////
public async sendEmailToUserOfItsPollsList(email: string): Promise<void> {
if (this.loaderService.isLoading) {
return;
}
// if (this.loaderService.isLoading) {
// return;
// }
// If user is not authenticated: the list of polls is send to user's email by the backend.
try {
this.loaderService.setStatus(false);
// this.loaderService.setStatus(false);
await this.axiosInstance.get<Poll[]>(
`${this.usersEndpoint}/${email}${this.usersPollsEndpoint}${this.usersPollsSendEmailEndpoint}`
);