Skip to content

Commit b85d2f2

Browse files
committed
Moved if-statement to fix failing test
1 parent 72f9eb2 commit b85d2f2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

app/Services/FilterService/FilterService.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -244,16 +244,16 @@ protected function applySingleFilter(Builder &$q, array $filterObj)
244244
// === 5. Handle assignedTo ===
245245
if ($fieldname === 'assigned_to') {
246246

247-
if ($value['value'] == '') {
248-
return;
249-
}
250247

251248
// Check if type is valid
252249
$validTypes = [Asset::class, Location::class, User::class];
253250
if (!in_array($value['type'], $validTypes)) {
254251
throw new \UnexpectedValueException('You\'ve provided an invalid type');
255252
}
256-
253+
254+
if ($value['value'] == '') {
255+
return;
256+
}
257257

258258
// === 5a. Handle assignedTo location ===
259259
if ($value['type'] === Location::class) {

0 commit comments

Comments
 (0)