Skip to content

Commit

Permalink
fix: do not use negative indices
Browse files Browse the repository at this point in the history
Signed-off-by: Cleopatra Enjeck M <patrathewhiz@gmail.com>
  • Loading branch information
enjeck committed Apr 14, 2024
1 parent dd9a4ad commit 91c8db9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/Service/TableTemplateService.php
Original file line number Diff line number Diff line change
Expand Up @@ -469,8 +469,8 @@ private function makeVacationRequests(Table $table):void {
'title' => $this->l->t('Create Vacation Request'),
'emoji' => '️➕',
'columns' => json_encode([$columns['employee']->getId(), $columns['from']->getId(), $columns['to']->getId(), $columns['workingDays']->getId(), $columns['dateRequest']->getId()]),
'sort' => json_encode([["columnId" => -5, "mode" => "ASC"]]),
'filter' => json_encode([[["columnId" => -2, "operator" => "is-equal", "value" => "@my-name"], ["columnId" => $columns['approved']->getId(), "operator" => "is-empty", "value" => ""]]]),
'sort' => json_encode([["columnId" => $columns['from']->getId(), "mode" => "ASC"]]),
'filter' => json_encode([[["columnId" => $columns['employee']->getId(), "operator" => "is-equal", "value" => "@my-name"], ["columnId" => $columns['approved']->getId(), "operator" => "is-empty", "value" => ""]]]),
]
);
$this->createView($table,
Expand All @@ -491,8 +491,8 @@ private function makeVacationRequests(Table $table):void {
'columns' => json_encode(array_values(array_map(function ($col) {
return $col->getId();
}, $columns))),
'sort' => json_encode([["columnId" => -3, "mode" => "ASC"]]),
'filter' => json_encode([[["columnId" => -2, "operator" => "is-equal", "value" => "@my-name"]]]),
'sort' => json_encode([["columnId" => $columns['dateRequest']->getId(), "mode" => "ASC"]]),
'filter' => json_encode([[["columnId" => $columns['employee']->getId(), "operator" => "is-equal", "value" => "@my-name"]]]),
]
);
$this->createView($table,
Expand All @@ -502,7 +502,7 @@ private function makeVacationRequests(Table $table):void {
'columns' => json_encode(array_values(array_map(function ($col) {
return $col->getId();
}, $columns))),
'sort' => json_encode([["columnId" => -3, "mode" => "ASC"]]),
'sort' => json_encode([["columnId" => $columns['dateRequest']->getId(), "mode" => "ASC"]]),
'filter' => json_encode([[["columnId" => $columns['approved']->getId(), "operator" => "is-equal", "value" => "@checked"]], [["columnId" => $columns['approved']->getId(), "operator" => "is-equal", "value" => "@unchecked"]]]),
]
);
Expand Down

0 comments on commit 91c8db9

Please sign in to comment.