discourse/app/assets/javascripts/admin/addon/routes/admin-backups-index.js
2020-12-01 15:31:26 -03:00

22 lines
432 B
JavaScript

import Backup from "admin/models/backup";
import Route from "@ember/routing/route";
export default Route.extend({
activate() {
this.messageBus.subscribe("/admin/backups", (backups) =>
this.controller.set(
"model",
backups.map((backup) => Backup.create(backup))
)
);
},
model() {
return Backup.find();
},
deactivate() {
this.messageBus.unsubscribe("/admin/backups");
},
});