Skip to content

Commit

Permalink
Filter only employees on vacation management
Browse files Browse the repository at this point in the history
  • Loading branch information
anarute committed Feb 2, 2022
1 parent d33aac5 commit 7e7743f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions model/facade/UsersFacade.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ static function GetAllUsers() {

}

static function GetAllActiveUsers() {
$action = new GetAllActiveUsersAction();
static function GetAllActiveUsers($filterEmployees = false) {
$action = new GetAllActiveUsersAction($filterEmployees);
return $action->execute();
}

Expand Down
2 changes: 1 addition & 1 deletion web/js/holidayManagement.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ var app = new Vue({
}
},
async fetchUsers() {
const url = `services/getAllUsersService.php?active=true`;
const url = `services/getAllUsersService.php?active=true&filterEmployees=true`;
const res = await fetch(url, {
method: 'GET',
mode: 'same-origin',
Expand Down
3 changes: 2 additions & 1 deletion web/services/getAllUsersService.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@

$sid = $_GET['sid'] ?? NULL;
$active = $_GET['active'] ?? NULL;
$filterEmployees = $_GET['filterEmployees'] ?? false;

do {
/* We check authentication and authorization */
Expand All @@ -53,7 +54,7 @@

if ($active == "true")
{
$users = UsersFacade::GetAllActiveUsers();
$users = UsersFacade::GetAllActiveUsers($filterEmployees);
}
else
{
Expand Down

0 comments on commit 7e7743f

Please sign in to comment.