This commit is contained in:
Adrian Hopek
2022-04-08 12:42:24 +02:00
parent 4af0482a93
commit 6506855bba
50 changed files with 581 additions and 196 deletions

View File

@@ -21,7 +21,7 @@ class ClearVacationRequestDaysInGoogleCalendar implements ShouldQueue
public function handle(): void
{
foreach ($this->vacationRequest->event_ids as $eventId) {
foreach ($this->vacationRequest->event_ids ?? [] as $eventId) {
$calendarEvent = Event::find($eventId);
if ($calendarEvent->googleEvent->getStatus() !== "cancelled") {

View File

@@ -32,7 +32,7 @@ class SendVacationRequestDaysToGoogleCalendar implements ShouldQueue
$ranges = $this->prepareRanges($days);
foreach ($ranges as $range) {
$text = "{$this->vacationRequest->type->label()} - {$this->vacationRequest->user->fullName} [{$this->vacationRequest->name}]";
$text = "{$this->vacationRequest->type->label()} - {$this->vacationRequest->user->profile->fullName} [{$this->vacationRequest->name}]";
$event = Event::create([
"name" => $text,