Files
Andrei PrigorshnevandGitHub 4db04ee80c FEATURE: Export chat messages to CSV file (#22113)
To export chat messages, go to `/admin/plugins/chat` and click the Create export 
button in the _Export chat messages_ section. You'll receive a direct message 
when the export is finished.

Currently, this exports all messages from the last 6 months, but not more than 
10000 messages.

This exports all chat messages, including messages from private channels and 
users' direct conversations. This also exports messages that were deleted.
2023-06-21 16:13:36 +04:00

20 lines
386 B
JavaScript

import Service from "@ember/service";
import { ajax } from "discourse/lib/ajax";
export default class ChatAdminApi extends Service {
async exportMessages() {
await this.#post(`/export/messages`);
}
get #basePath() {
return "/chat/admin";
}
#post(endpoint, data = {}) {
return ajax(`${this.#basePath}${endpoint}`, {
type: "POST",
data,
});
}
}