Skip to content

Commit

Permalink
ajouts
Browse files Browse the repository at this point in the history
  • Loading branch information
Romuald Caplier committed Apr 10, 2024
1 parent 02ec145 commit 7899bfe
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,11 @@ export class RecordUserFeedbacksComponent implements OnInit, OnDestroy {

onNewAnswer(newUserFeedback: UserFeedback) {
this.userFeedBackService.postUserFeedback(newUserFeedback)
// this.cdr.markForCheck()
}

publishNewComment() {
const newFeedback = {
const newFeedback: UserFeedback = {
uuid: undefined,
comment: this.newComment,
parentUuid: null,
date: undefined,
Expand All @@ -105,6 +105,5 @@ export class RecordUserFeedbacksComponent implements OnInit, OnDestroy {

this.userFeedBackService.postUserFeedback(newFeedback)
this.newComment = ''
this.cdr.markForCheck()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export class Gn4PlatformMapper {
})
}

userFeedbacksFromApi(userFeedbacks: any[]): UserFeedback[] { // TODO <--------------------------------------------------------------------- TODO: TYPER
userFeedbacksFromApi(userFeedbacks: any[]): UserFeedback[] {
return userFeedbacks.map(userFeedback => ({
uuid: userFeedback.uuid,
comment: userFeedback.comment,
Expand Down
14 changes: 7 additions & 7 deletions libs/common/domain/src/lib/model/record/user-feedbacks.model.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
export interface UserFeedback {
uuid?: string
comment?: string
authorUserId?: number
authorName?: string
authorEmail?: string
published?: boolean
uuid: string
comment: string
authorUserId: number
authorName: string
authorEmail: string
published: boolean
parentUuid?: string
date?: string
date: string
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,10 @@ export class UserFeedbackItemComponent implements OnInit {
publishNewAnswer() {
this.newAnswerEmitter.emit({
...this.userFeedback,
uuid: undefined,
comment: this.newAnswer,
parentUuid: this.userFeedback.uuid,
authorUserId: Number.parseInt(this.activeUser?.id), // todo: il faut faire quelque chose avec ces userId number alors que tout le reste est en uuid...
authorUserId: Number.parseInt(this.activeUser?.id), // todo: Shouldn't we do something with this? Convert it to uuid like it's done everywhere else ?...
authorEmail: this.activeUser?.email,
authorName: `${this.activeUser?.name} ${this.activeUser?.surname}`
})
Expand Down

0 comments on commit 7899bfe

Please sign in to comment.