diff --git a/src/app/core/services/api.service.ts b/src/app/core/services/api.service.ts index 0f3604ec..16b03466 100644 --- a/src/app/core/services/api.service.ts +++ b/src/app/core/services/api.service.ts @@ -20,9 +20,6 @@ const apiEndpoints = environment.api.endpoints; providedIn: 'root', }) export class ApiService { - private static loader: LoaderService; - private useDevLocalServer = true; - private devLocalServerBaseHref = 'http://localhost:8000/'; private axiosInstance: AxiosInstance; private readonly pollsEndpoint = apiEndpoints.polls.name; private readonly answersEndpoint = apiEndpoints.polls.answers.name; @@ -32,8 +29,9 @@ export class ApiService { private readonly usersPollsEndpoint = apiEndpoints.users.polls.name; private readonly usersPollsSendEmailEndpoint = apiEndpoints.users.polls.sendEmail.name; private baseHref: string; + private static loaderService: LoaderService; - constructor(private http: HttpClient, private loader: LoaderService, private toastService: ToastService) { + constructor(private http: HttpClient, private loaderService: LoaderService) { this.baseHref = apiBaseHref; this.axiosInstance = axios.create({ baseURL: apiBaseHref }); @@ -81,7 +79,7 @@ export class ApiService { } private static handleError(error): void { - // this.loader.setStatus(true); + // this.loaderService.setStatus(true); if (error.response) { // The request was made and the server responded with a status code // that falls out of the range of 2xx @@ -98,13 +96,13 @@ export class ApiService { console.log('Error', error.message); } console.log(error.config); - this.loader.setStatus(false); + this.loaderService.setStatus(false); } public async createPoll(poll: Poll): Promise { - // this.loader.setStatus(true); + // this.loaderService.setStatus(true); console.log('createPoll config', poll); - this.loader.setStatus(true); + this.loaderService.setStatus(true); return this.axiosInstance.post( `${this.baseHref}${currentApiRoutes['api_new_poll']}`, poll, @@ -302,12 +300,12 @@ export class ApiService { ///////////////////// public async sendEmailToUserOfItsPollsList(email: string): Promise { - if (this.loader.isLoading) { + 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.loader.setStatus(false); + this.loaderService.setStatus(false); await this.axiosInstance.get( `${this.usersEndpoint}/${email}${this.usersPollsEndpoint}${this.usersPollsSendEmailEndpoint}` ); diff --git a/src/app/features/administration/form/date/list/day/day-list.component.scss b/src/app/features/administration/form/date/list/day/day-list.component.scss index a2d8e796..41bed285 100644 --- a/src/app/features/administration/form/date/list/day/day-list.component.scss +++ b/src/app/features/administration/form/date/list/day/day-list.component.scss @@ -11,6 +11,7 @@ } .several-times { padding-left: 2em; + width: 96.5%; } .date-choice { &:nth-child(odd) {