Skip to content

Commit c28d75d

Browse files
committed
fix: add admin location filter to reservation calendar events
Signed-off-by: Sam Poyigi <6567634+sampoyigi@users.noreply.github.com>
1 parent 9b689df commit c28d75d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

app/admin/controllers/Reservations.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Admin\Controllers;
44

55
use Admin\ActivityTypes\StatusUpdated;
6+
use Admin\Facades\AdminLocation;
67
use Admin\Facades\AdminMenu;
78
use Admin\Models\Reservations_model;
89
use Admin\Models\Statuses_model;
@@ -118,7 +119,7 @@ public function edit_onDelete($context, $recordId)
118119
public function calendarGenerateEvents($startAt, $endAt)
119120
{
120121
return Reservations_model::listCalendarEvents(
121-
$startAt, $endAt, $this->getLocationId()
122+
$startAt, $endAt, AdminLocation::getIdOrAll(),
122123
);
123124
}
124125

@@ -140,7 +141,7 @@ public function calendarUpdateEvent($eventId, $startAt, $endAt)
140141
public function formExtendQuery($query)
141142
{
142143
$query->with([
143-
'status_history' => function ($q) {
144+
'status_history' => function($q) {
144145
$q->orderBy('created_at', 'desc');
145146
},
146147
'status_history.staff',

0 commit comments

Comments
 (0)