FIX: removes missed chat_channels legacy paths (#19634)
- chat-channel-by-name is no longer supported - chat_channels_controller doesn’t exist anymore
This commit is contained in:
parent
7b53973bd8
commit
aad63d92d2
|
@ -20,6 +20,5 @@ export default function () {
|
||||||
this.route("archived", { path: "/archived" });
|
this.route("archived", { path: "/archived" });
|
||||||
});
|
});
|
||||||
this.route("message", { path: "/message/:messageId" });
|
this.route("message", { path: "/message/:messageId" });
|
||||||
this.route("channelByName", { path: "/chat_channels/:channelName" });
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,28 +0,0 @@
|
||||||
import DiscourseRoute from "discourse/routes/discourse";
|
|
||||||
import { defaultHomepage } from "discourse/lib/utilities";
|
|
||||||
import { ajax } from "discourse/lib/ajax";
|
|
||||||
import { inject as service } from "@ember/service";
|
|
||||||
|
|
||||||
export default class ChatChannelByNameRoute extends DiscourseRoute {
|
|
||||||
@service chat;
|
|
||||||
|
|
||||||
async model(params) {
|
|
||||||
return ajax(
|
|
||||||
`/chat/chat_channels/${encodeURIComponent(params.channelName)}.json`
|
|
||||||
)
|
|
||||||
.then((response) => {
|
|
||||||
this.transitionTo(
|
|
||||||
"chat.channel",
|
|
||||||
response.channel.id,
|
|
||||||
response.channel.title
|
|
||||||
);
|
|
||||||
})
|
|
||||||
.catch(() => this.replaceWith("/404"));
|
|
||||||
}
|
|
||||||
|
|
||||||
beforeModel() {
|
|
||||||
if (!this.chat.userCanChat) {
|
|
||||||
return this.transitionTo(`discovery.${defaultHomepage()}`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -627,12 +627,6 @@ after_initialize do
|
||||||
# incoming_webhooks_controller routes
|
# incoming_webhooks_controller routes
|
||||||
post "/hooks/:key/slack" => "incoming_chat_webhooks#create_message_slack_compatible"
|
post "/hooks/:key/slack" => "incoming_chat_webhooks#create_message_slack_compatible"
|
||||||
|
|
||||||
# chat_channel_controller routes
|
|
||||||
get "/chat_channels" => "chat_channels#index"
|
|
||||||
post "/chat_channels/:chat_channel_id/notification_settings" =>
|
|
||||||
"chat_channels#notification_settings"
|
|
||||||
get "/chat_channels/:chat_channel_id" => "chat_channels#show"
|
|
||||||
|
|
||||||
# chat_controller routes
|
# chat_controller routes
|
||||||
get "/" => "chat#respond"
|
get "/" => "chat#respond"
|
||||||
get "/browse" => "chat#respond"
|
get "/browse" => "chat#respond"
|
||||||
|
|
Loading…
Reference in New Issue