discourse/app/assets/javascripts/admin/addon/routes/admin-backups-index.js
David Taylor 48193767bf DEV: Sort imports
Automatically generated by `eslint --fix` to satisfy the updated configuration
2023-10-10 21:46:54 +01:00

28 lines
634 B
JavaScript

import Route from "@ember/routing/route";
import { bind } from "discourse-common/utils/decorators";
import Backup from "admin/models/backup";
export default class AdminBackupsIndexRoute extends Route {
activate() {
this.messageBus.subscribe("/admin/backups", this.onMessage);
}
deactivate() {
this.messageBus.unsubscribe("/admin/backups", this.onMessage);
}
model() {
return Backup.find().then((backups) =>
backups.map((backup) => Backup.create(backup))
);
}
@bind
onMessage(backups) {
this.controller.set(
"model",
backups.map((backup) => Backup.create(backup))
);
}
}