Skip to content

Commit

Permalink
FIX argument edits
Browse files Browse the repository at this point in the history
  • Loading branch information
ilmartyrk committed Dec 19, 2023
1 parent 7eb55f2 commit a178e52
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export class EditArgumentComponent implements OnInit {
return this.ARGUMENT_TYPES_MAXLENGTH[this.edit.type] || this.ARGUMENT_TYPES_MAXLENGTH.pro;
}
updateArgument() {
console.log('UPDATE', this.edit);
if (this.edit.type !== this.argument.type || this.argument.subject !== this.edit.subject || this.argument.text !== this.edit.text) {
this.TopicArgumentService.update(this.edit)
.pipe(take(1))
Expand Down Expand Up @@ -95,8 +96,7 @@ export class EditArgumentComponent implements OnInit {
};

ngOnInit(): void {
this.edit = Object.assign(this.edit, this.argument);
this.edit.topicId = this.topicId;
this.edit = Object.assign(this.edit, {id: this.argument.id, subject: this.argument.subject, text: this.argument.text, type: this.argument.type, topicId: this.topicId});
}

}
2 changes: 1 addition & 1 deletion src/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@
"CHARACTER_LIMIT": "@:COMPONENTS.GROUP_INVITE.CHARACTER_LIMIT",
"PLACEHOLDER_EXPLAIN_YOUR_ARGUMENT": "@:COMPONENTS.POST_ARGUMENT.PLACEHOLDER_EXPLAIN_YOUR_ARGUMENT",
"BTN_ADD_IMAGE": "@:COMPONENTS.POST_ARGUMENT.BTN_ADD_IMAGE",
"BTN_ARGUMENT_POST": "@:COMPONENTS.EDIT_ARGUMENT.EDIT_YOUR_ARGUMENT"
"BTN_ARGUMENT_POST": "@:VIEWS.TOPIC_CREATE.FOOTER_BTN_SAVE_CHANGES"
},
"POST_ARGUMENT": {
"FOOTER_MENU_TITLE": "Join discussion",
Expand Down

0 comments on commit a178e52

Please sign in to comment.