FIX: Move posts modal passing topic instance rather than ID (#30622)
Fixes issue in type difference due to modernization in this commit df9de3022f
This commit is contained in:
parent
20a16ea231
commit
260017de1d
|
@ -70,7 +70,7 @@
|
|||
<form>
|
||||
<ChooseMessage
|
||||
@currentTopicId={{@model.topic.id}}
|
||||
@setSelectedTopicId={{fn (mut this.selectedTopicId)}}
|
||||
@setSelectedTopicId={{fn (mut this.selectedTopic)}}
|
||||
/>
|
||||
|
||||
<label>{{i18n "topic.move_to_new_message.participants"}}</label>
|
||||
|
@ -80,7 +80,7 @@
|
|||
@onChange={{fn (mut this.participants)}}
|
||||
/>
|
||||
|
||||
{{#if this.selectedTopicId}}
|
||||
{{#if this.selectedTopic}}
|
||||
<hr />
|
||||
<label for="chronological-order" class="checkbox-label">
|
||||
<Input
|
||||
|
@ -147,7 +147,7 @@
|
|||
@currentTopicId={{@model.topic.id}}
|
||||
/>
|
||||
|
||||
{{#if this.selectedTopicId}}
|
||||
{{#if this.selectedTopic}}
|
||||
<hr />
|
||||
<label for="chronological-order" class="checkbox-label">
|
||||
<Input
|
||||
|
|
|
@ -19,7 +19,7 @@ export default class MoveToTopic extends Component {
|
|||
@tracked participants = [];
|
||||
@tracked chronologicalOrder = false;
|
||||
@tracked selection = "new_topic";
|
||||
@tracked selectedTopicId;
|
||||
@tracked selectedTopic;
|
||||
@tracked flash;
|
||||
|
||||
constructor() {
|
||||
|
@ -49,7 +49,7 @@ export default class MoveToTopic extends Component {
|
|||
|
||||
get buttonDisabled() {
|
||||
return (
|
||||
this.saving || (isEmpty(this.selectedTopicId) && isEmpty(this.topicName))
|
||||
this.saving || (isEmpty(this.selectedTopic) && isEmpty(this.topicName))
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -110,7 +110,7 @@ export default class MoveToTopic extends Component {
|
|||
|
||||
if (type === "existingTopic") {
|
||||
mergeOptions = {
|
||||
destination_topic_id: this.selectedTopicId,
|
||||
destination_topic_id: this.selectedTopic.id,
|
||||
chronological_order: this.chronologicalOrder,
|
||||
};
|
||||
moveOptions = {
|
||||
|
@ -119,7 +119,7 @@ export default class MoveToTopic extends Component {
|
|||
};
|
||||
} else if (type === "existingMessage") {
|
||||
mergeOptions = {
|
||||
destination_topic_id: this.selectedTopicId,
|
||||
destination_topic_id: this.selectedTopic.id,
|
||||
participants: this.participants.join(","),
|
||||
archetype: "private_message",
|
||||
chronological_order: this.chronologicalOrder,
|
||||
|
@ -190,6 +190,6 @@ export default class MoveToTopic extends Component {
|
|||
|
||||
@action
|
||||
newTopicSelected(topic) {
|
||||
this.selectedTopicId = topic.id;
|
||||
this.selectedTopic = topic;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue