diff --git a/src/app/core/services/api.service.ts b/src/app/core/services/api.service.ts index c737a2c0..362470fb 100644 --- a/src/app/core/services/api.service.ts +++ b/src/app/core/services/api.service.ts @@ -287,4 +287,24 @@ export class ApiService { console.log(error.config); // this.loaderService.setStatus(false); } + public ousideHandleError(error) { + // 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 + console.error('Error response data', error.response.data); + console.error('Error response status', error.response.status); + console.error('Error response headers', error.response.headers); + } else if (error.request) { + // The request was made but no response was received + // `error.request` is an instance of XMLHttpRequest in the browser and an instance of + // http.ClientRequest in node.js + console.log('ErrorRequest', error.request); + } else { + // Something happened in setting up the request that triggered an Error + console.log('Error', error.message); + } + console.log(error.config); + // this.loaderService.setStatus(false); + } } diff --git a/src/app/core/services/storage.service.ts b/src/app/core/services/storage.service.ts index 4a37ee61..3d683146 100644 --- a/src/app/core/services/storage.service.ts +++ b/src/app/core/services/storage.service.ts @@ -61,10 +61,9 @@ export class StorageService { } setChoicesForVoteStack(choices_list: Choice[]) { - this.vote_stack.votes = []; - // text choices if (!this.vote_stack.id) { + this.vote_stack.votes = []; for (const choice of choices_list) { if (environment.autofill) { console.log('autofill au hasard des votes à ce sondage'); diff --git a/src/app/features/consultation/consultation.component.html b/src/app/features/consultation/consultation.component.html index 570bc090..55bb09bf 100644 --- a/src/app/features/consultation/consultation.component.html +++ b/src/app/features/consultation/consultation.component.html @@ -2,72 +2,75 @@
-
+
⚰️ Ce sondage a expiré, il n'est plus possible d'y ajouter de votes ou de commentaires
-
-
-
- aucun vote pour le moment -
-
-
+ + +
Vous ne pouvez modifier que votre propre vote à ce sondage
-
+ -
- -
-
-

{{ poll.title }}

-
{{ poll.stacks.length }} votants
- +
+
+
+

{{ poll.title }}

+

{{ poll.description }}

+
+ {{ poll.stacks.length }} votants +
+

author : {{ poll.owner?.pseudo }}

+
+
+ + + + + + +
+ +
+
+
-

{{ poll.description }}

+ + +
+
+
+ aucun vote pour le moment +
+
+ + +
+
+