mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 13:11:18 +08:00
UX: Enabled sorting for more columns in admin user list (#7208)
This commit is contained in:
@ -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", () => {
|
||||
|
Reference in New Issue
Block a user