Skip to content

Commit

Permalink
Merge pull request #481 from timeoff-management/tom-xxx-sort-users-in…
Browse files Browse the repository at this point in the history
…-book-leave-modal

Sort users in the "For" dropdown on book a leave modal
  • Loading branch information
vpp authored Jul 7, 2021
2 parents ae23729 + dc876a3 commit 688cac3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/model/db/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,8 @@ function get_instance_methods(sequelize) {
self.get_company_with_all_leave_types(),
self.promise_schedule_I_obey(),
function(users, company, schedule){
self.supervised_users = users || [];
const supervisedUsers = users || [];
self.supervised_users = supervisedUsers.sort((a,b) => a.name.localeCompare(b.name));
self.company = company;

// Note: we do not do anithing with scheduler as "promise_schedule_I_obey"
Expand Down

0 comments on commit 688cac3

Please sign in to comment.