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:
Joffrey JAFFEUX 2022-12-27 20:56:26 +01:00 committed by GitHub
parent 7b53973bd8
commit aad63d92d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 0 additions and 35 deletions

View File

@ -20,6 +20,5 @@ export default function () {
this.route("archived", { path: "/archived" });
});
this.route("message", { path: "/message/:messageId" });
this.route("channelByName", { path: "/chat_channels/:channelName" });
});
}

View File

@ -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()}`);
}
}
}

View File

@ -627,12 +627,6 @@ after_initialize do
# incoming_webhooks_controller routes
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
get "/" => "chat#respond"
get "/browse" => "chat#respond"