mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-29 16:15:04 +00:00
feat: calendar name
This commit is contained in:
@@ -19,6 +19,8 @@ use Eluceo\iCal\Domain\ValueObject\Date;
|
||||
use Eluceo\iCal\Domain\ValueObject\EmailAddress;
|
||||
use Eluceo\iCal\Domain\ValueObject\SingleDay;
|
||||
use Eluceo\iCal\Domain\ValueObject\Timestamp;
|
||||
use Eluceo\iCal\Presentation\Component\Property;
|
||||
use Eluceo\iCal\Presentation\Component\Property\Value\TextValue;
|
||||
use Eluceo\iCal\Presentation\Factory\CalendarFactory;
|
||||
use Sabre\VObject\EofException;
|
||||
use Sabre\VObject\InvalidDataException;
|
||||
@@ -114,7 +116,13 @@ class WatchListController extends AbstractController
|
||||
}
|
||||
}
|
||||
|
||||
return new Response((new CalendarFactory())->createCalendar($calendar), Response::HTTP_OK, [
|
||||
$calendarResponse = (new CalendarFactory())->createCalendar($calendar);
|
||||
$calendarName = $watchList->getName();
|
||||
if (null !== $calendarName) {
|
||||
$calendarResponse->withProperty(new Property('X-WR-CALNAME', new TextValue($calendarName)));
|
||||
}
|
||||
|
||||
return new Response($calendarResponse, Response::HTTP_OK, [
|
||||
'Content-Type' => 'text/calendar; charset=utf-8',
|
||||
]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user