feat: reduce amount of data loaded on acp admin page

get rid of socket call and use ajaxify.data.categories
This commit is contained in:
Barış Soner Uşaklı
2020-07-29 11:57:20 -04:00
parent 7331faed9f
commit 8d8117ffa1
3 changed files with 22 additions and 11 deletions

View File

@@ -11,13 +11,7 @@ define('admin/manage/categories', [
var sortables;
Categories.init = function () {
socket.emit('admin.categories.getAll', function (err, payload) {
if (err) {
return app.alertError(err.message);
}
Categories.render(payload);
});
Categories.render(ajaxify.data.categories);
$('button[data-action="create"]').on('click', Categories.throwCreateModal);