fix(time-tracking) : return empty collection instead of 404 for active timer endpoint
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -20,14 +20,16 @@ final readonly class ActiveTimeEntryProvider implements ProviderInterface
|
||||
private TimeEntryRepository $timeEntryRepository,
|
||||
) {}
|
||||
|
||||
public function provide(Operation $operation, array $uriVariables = [], array $context = []): ?TimeEntry
|
||||
public function provide(Operation $operation, array $uriVariables = [], array $context = []): array
|
||||
{
|
||||
$user = $this->security->getUser();
|
||||
|
||||
if (!$user) {
|
||||
return null;
|
||||
return [];
|
||||
}
|
||||
|
||||
return $this->timeEntryRepository->findActiveByUser($user);
|
||||
$entry = $this->timeEntryRepository->findActiveByUser($user);
|
||||
|
||||
return $entry ? [$entry] : [];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user