UX: Enabled sorting for more columns in admin user list (#7208)

This commit is contained in:
Tim Lange
2019-03-21 10:16:58 +01:00
committed by Guo Xiang Tan
parent 4e594f2b2b
commit d16a0db4e1
7 changed files with 80 additions and 12 deletions

View File

@ -448,14 +448,32 @@ export default function() {
overridden: true
};
this.get("/admin/users/list/active.json", () => {
return response(200, [
this.get("/admin/users/list/active.json", request => {
let store = [
{
id: 1,
username: "eviltrout",
email: "<small>eviltrout@example.com</small>"
},
{
id: 3,
username: "discobot",
email: "<small>discobot_email</small>"
}
]);
];
const ascending = request.queryParams.ascending;
const order = request.queryParams.order;
if (order) {
store = store.sort(function(a, b) {
return a[order] - b[order];
});
}
if (ascending) {
store = store.reverse();
}
return response(200, store);
});
this.get("/admin/users/list/suspect.json", () => {