fix hydration issues in favorites (#5068)

This commit is contained in:
Kevin Papst
2024-09-20 22:43:16 +02:00
committed by GitHub
parent 537c120ad9
commit 036b297a76
2 changed files with 4 additions and 4 deletions

View File

@@ -112,11 +112,11 @@ final class FavoriteRecordService
public function removeFavorite(Timesheet $timesheet): void
{
if ($timesheet->getUser() === null) {
throw new \InvalidArgumentException('Cannot favorite timesheet without user');
throw new \InvalidArgumentException('Cannot remove favorite without user');
}
if ($timesheet->getId() === null) {
throw new \InvalidArgumentException('Cannot favorite unsaved timesheet');
throw new \InvalidArgumentException('Cannot remove unsaved favorite');
}
$this->removeFavoriteById($timesheet->getUser(), $timesheet->getId());