From e45b490c2fdbdff37e5a252a478091b52b287612 Mon Sep 17 00:00:00 2001 From: Tykayn Date: Mon, 26 Apr 2021 17:04:16 +0200 Subject: [PATCH] fix models for backend update --- src/app/core/models/comment.model.ts | 2 +- src/app/core/models/poll.model.ts | 2 +- src/app/core/services/poll.service.ts | 2 +- .../consultation/consultation.component.html | 6 ++-- .../consultation/consultation.component.ts | 2 +- .../poll-results-compact.component.html | 36 +++++++++---------- .../comments/comments.component.html | 4 +-- 7 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/app/core/models/comment.model.ts b/src/app/core/models/comment.model.ts index ff47d739..0cce1157 100644 --- a/src/app/core/models/comment.model.ts +++ b/src/app/core/models/comment.model.ts @@ -1,7 +1,7 @@ import { User } from './user.model'; export class Comment { - constructor(public owner: User, public text: string, public pseudo: string, public created_at: string) {} + constructor(public text: string, public pseudo: string, public created_at: string) {} public static sortChronologically(first: Comment, second: Comment): number { const a = new Date(first.created_at); diff --git a/src/app/core/models/poll.model.ts b/src/app/core/models/poll.model.ts index 212d904c..66274463 100644 --- a/src/app/core/models/poll.model.ts +++ b/src/app/core/models/poll.model.ts @@ -39,7 +39,7 @@ export class Poll { public votes = []; - public stacks_of_votes = []; + public stacks = []; public allowed_answers = []; diff --git a/src/app/core/services/poll.service.ts b/src/app/core/services/poll.service.ts index 635b07da..421fb2e1 100644 --- a/src/app/core/services/poll.service.ts +++ b/src/app/core/services/poll.service.ts @@ -160,7 +160,7 @@ export class PollService implements Resolve { public buildAnswersByChoiceLabelByPseudo(poll: Poll): Map> { const pseudos: Set = new Set(); - poll.votes.forEach((choice: Choice) => { + poll.choices.forEach((choice: Choice) => { // choice.voters.forEach((users: Set) => { // users.forEach((user: User) => { // pseudos.add(user.pseudo); diff --git a/src/app/features/consultation/consultation.component.html b/src/app/features/consultation/consultation.component.html index 7cce6e23..0345d140 100644 --- a/src/app/features/consultation/consultation.component.html +++ b/src/app/features/consultation/consultation.component.html @@ -6,7 +6,7 @@ ⚰️ Ce sondage a expiré, il n'est plus possible d'y ajouter de votes ou de commentaires -
+
aucun vote pour le moment
@@ -66,7 +66,7 @@
-

{{ poll.description }}

+

{{ poll.description }}

- +
diff --git a/src/app/features/consultation/consultation.component.ts b/src/app/features/consultation/consultation.component.ts index f8c14c0a..87f56e41 100644 --- a/src/app/features/consultation/consultation.component.ts +++ b/src/app/features/consultation/consultation.component.ts @@ -97,7 +97,7 @@ export class ConsultationComponent implements OnInit, OnDestroy { }); listOfChoices.push('pseudo'); - this.poll.stacks_of_votes.map((voteStack) => { + this.poll.stacks.map((voteStack) => { const voteStackInArray = [voteStack.pseudo]; const keysVotes = Object.keys(voteStack.votes); diff --git a/src/app/features/consultation/poll-results-compact/poll-results-compact.component.html b/src/app/features/consultation/poll-results-compact/poll-results-compact.component.html index 53ed12ff..338571d6 100644 --- a/src/app/features/consultation/poll-results-compact/poll-results-compact.component.html +++ b/src/app/features/consultation/poll-results-compact/poll-results-compact.component.html @@ -9,24 +9,24 @@ -
-
- - - -
-
+ + + + + + + + + + + + + + diff --git a/src/app/shared/components/comments/comments.component.html b/src/app/shared/components/comments/comments.component.html index 73205cfd..22bd3962 100644 --- a/src/app/shared/components/comments/comments.component.html +++ b/src/app/shared/components/comments/comments.component.html @@ -69,8 +69,8 @@ il y a - {{ calculateDaysAgoOfComment(comment.owner.created_at) }} jours, le {{ comment.owner.created_at }} + {{ calculateDaysAgoOfComment(comment.date.date) }} jours, le {{ comment.date.date }}