-
{{config.currentPoll.data.title}}
-
{{config.currentPoll.data.description}}
+
{{config.currentPoll.poll.title}}
+
{{config.currentPoll.poll.description}}
- Créé le {{config.currentPoll.data.creationDate.date}}
+ Créé le {{config.currentPoll.poll.creationDate.date}}
- Expire le {{config.currentPoll.data.expiracyDate.date}}
+ Expire le {{config.currentPoll.poll.expiracyDate.date}}
@@ -73,7 +73,7 @@
@@ -132,12 +132,19 @@
class="btn btn--primary btn--outline"
value="Ajouter mon commentaire"
(click)='config.addComment()' >
-
-
+
-
+
Partager le sondage
diff --git a/src/app/services/config.service.ts b/src/app/services/config.service.ts
index a3074e05..9d48f27b 100644
--- a/src/app/services/config.service.ts
+++ b/src/app/services/config.service.ts
@@ -163,7 +163,7 @@ export class ConfigService extends PollConfig {
)
.subscribe((res: any) => {
- this.customUrlIsUnique = res.data.isUnique;
+ this.customUrlIsUnique = res.poll.isUnique;
this.loading = false;
},
(e) => this.handleError(e))
@@ -262,7 +262,7 @@ export class ConfigService extends PollConfig {
)
.subscribe(
(res: any) => {
- this.myPolls = res.data;
+ // this.myPolls = res.poll;
}, (e) => {
this.handleError(e)
}
@@ -279,13 +279,13 @@ export class ConfigService extends PollConfig {
}
updateCurrentPollFromResponse(res: any) {
- this.currentPoll = res.data;
+ this.currentPoll = res.poll;
this.currentPoll.admin_key = res.admin_key;
- this.pollId = res.data.id;
- this.urlPublic = this.baseHref + '#/vote/poll/id/' + res.data.id;
- this.urlSlugPublic = this.baseHref + '#/vote/poll/slug/' + res.data.id;
- if (res.data.customUrl) {
- this.urlSlugPublic = this.baseHref + '#/vote/poll/id/' + res.data.customUrl;
+ this.pollId = res.poll.id;
+ this.urlPublic = this.baseHref + '#/vote/poll/id/' + res.poll.id;
+ this.urlSlugPublic = this.baseHref + '#/vote/poll/slug/' + res.poll.id;
+ if (res.poll.customUrl) {
+ this.urlSlugPublic = this.baseHref + '#/vote/poll/id/' + res.poll.customUrl;
}
this.urlAdmin = this.baseHref + '#/admin/' + res.admin_key;
}
@@ -532,7 +532,7 @@ export class ConfigService extends PollConfig {
severity: 'success',
summary: 'Sondage mis à jour',
});
- this.currentPoll = res.data;
+ this.updateCurrentPollFromResponse(res);
}, (e) => {
this.handleError(e)
}