further improvements for the mobile admin
This commit is contained in:
@@ -169,7 +169,6 @@ class SeedDemoSwitcherTenants extends Command
|
||||
attributes: [
|
||||
'subscription_tier' => 'standard',
|
||||
'subscription_status' => 'active',
|
||||
'event_credits_balance' => 1,
|
||||
],
|
||||
);
|
||||
|
||||
@@ -198,7 +197,6 @@ class SeedDemoSwitcherTenants extends Command
|
||||
attributes: [
|
||||
'subscription_tier' => 'starter',
|
||||
'subscription_status' => 'active',
|
||||
'event_credits_balance' => 0,
|
||||
],
|
||||
);
|
||||
|
||||
@@ -229,7 +227,6 @@ class SeedDemoSwitcherTenants extends Command
|
||||
attributes: [
|
||||
'subscription_tier' => 'reseller',
|
||||
'subscription_status' => 'active',
|
||||
'event_credits_balance' => 2,
|
||||
],
|
||||
);
|
||||
|
||||
@@ -294,7 +291,6 @@ class SeedDemoSwitcherTenants extends Command
|
||||
attributes: [
|
||||
'subscription_tier' => 'reseller',
|
||||
'subscription_status' => 'active',
|
||||
'event_credits_balance' => 0,
|
||||
],
|
||||
);
|
||||
|
||||
|
||||
@@ -139,11 +139,9 @@ class EventController extends Controller
|
||||
unset($eventData['features']);
|
||||
}
|
||||
|
||||
if ($settings === [] || $settings === null) {
|
||||
unset($eventData['settings']);
|
||||
} else {
|
||||
$eventData['settings'] = $settings;
|
||||
}
|
||||
$settings['branding_allowed'] = $package->branding_allowed !== false;
|
||||
|
||||
$eventData['settings'] = $settings;
|
||||
|
||||
foreach (['password', 'password_confirmation', 'password_protected', 'logo_image', 'cover_image'] as $unused) {
|
||||
unset($eventData[$unused]);
|
||||
@@ -233,6 +231,7 @@ class EventController extends Controller
|
||||
public function update(EventStoreRequest $request, Event $event): JsonResponse
|
||||
{
|
||||
$tenantId = $request->attributes->get('tenant_id');
|
||||
$event->loadMissing('eventPackage.package');
|
||||
|
||||
if ($event->tenant_id !== $tenantId) {
|
||||
return ApiError::response(
|
||||
@@ -259,10 +258,16 @@ class EventController extends Controller
|
||||
unset($validated[$unused]);
|
||||
}
|
||||
|
||||
$brandingAllowed = optional($event->eventPackage?->package)->branding_allowed !== false;
|
||||
|
||||
if (isset($validated['settings']) && is_array($validated['settings'])) {
|
||||
$validated['settings'] = array_merge($event->settings ?? [], $validated['settings']);
|
||||
} else {
|
||||
$validated['settings'] = $event->settings ?? [];
|
||||
}
|
||||
|
||||
$validated['settings']['branding_allowed'] = $brandingAllowed;
|
||||
|
||||
$event->update($validated);
|
||||
$event->load(['eventType', 'tenant']);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user