Fix tests
This commit is contained in:
parent
126c9e940f
commit
c2c3465dc4
2 changed files with 9 additions and 6 deletions
|
@ -12,8 +12,13 @@ class LocationUpdateService
|
|||
*/
|
||||
public function handle(Location|int $location, array $data): Location
|
||||
{
|
||||
$location = ($location instanceof Location) ? $location->id : $location;
|
||||
/** @var Location $location */
|
||||
if (is_int($location)) {
|
||||
$location = Location::query()->findOrFail($location);
|
||||
}
|
||||
|
||||
return $location->update($data);
|
||||
$location->update($data);
|
||||
|
||||
return $location;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue