extract calendar app id to constant

This commit is contained in:
stefan.tollkuehn committed 2026-10-08 13:33:07 +02:00
1 parent de814e9530
commit 8b54abe7d4
1 file changed
+7 -1
+7 -1
View File
@@ -28,6 +28,12 @@ class CalendarController extends Controller
*/ */
private const CALENDAR_NAME = 'Personal'; private const CALENDAR_NAME = 'Personal';
/*
* Nextcloud Calendar app id, target of the redirect
* after the event was created.
*/
private const CALENDAR_APP_ID = 'calendar';
/* /*
* Default reminder: 15 minutes before the event starts. * Default reminder: 15 minutes before the event starts.
*/ */
@@ -190,7 +196,7 @@ class CalendarController extends Controller
* otherwise the Nextcloud start page. linkToRoute() * otherwise the Nextcloud start page. linkToRoute()
* would throw for a disabled Calendar app. * would throw for a disabled Calendar app.
*/ */
$calendarUrl = $this->appManager->isEnabledForUser('calendar', $user) $calendarUrl = $this->appManager->isEnabledForUser(self::CALENDAR_APP_ID, $user)
? $this->urlGenerator->linkToRoute('calendar.view.index') ? $this->urlGenerator->linkToRoute('calendar.view.index')
: $this->urlGenerator->getAbsoluteURL('/'); : $this->urlGenerator->getAbsoluteURL('/');