Expand specialty modules; pin Emergency and Blood Bank on Pro.
Deploy Ladill Care / deploy (push) Successful in 1m37s
Deploy Ladill Care / deploy (push) Successful in 1m37s
Add Cardiology through Child Welfare to the specialty catalog, keep Emergency and Blood Bank always enabled on Pro/Enterprise sidebars, and generate matching demo specialty doctors. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -21,6 +21,11 @@ class SettingsModulesController extends Controller
|
||||
$member = $this->member($request);
|
||||
$canManage = app(\App\Services\Care\CarePermissions::class)->can($member, 'settings.manage');
|
||||
|
||||
if ($modules->canManage($organization)) {
|
||||
$modules->ensureDefaultModulesProvisioned($organization, $this->ownerRef($request));
|
||||
$organization->refresh();
|
||||
}
|
||||
|
||||
return view('care.settings.modules', [
|
||||
'organization' => $organization,
|
||||
'canManage' => $canManage,
|
||||
@@ -46,9 +51,13 @@ class SettingsModulesController extends Controller
|
||||
$desired = [];
|
||||
foreach ($keys as $key) {
|
||||
$desired[$key] = $request->boolean("modules.{$key}");
|
||||
if ($modules->isDefaultOnPaidPlans($key)) {
|
||||
$desired[$key] = true;
|
||||
}
|
||||
}
|
||||
|
||||
$result = $modules->sync($organization, $this->ownerRef($request), $desired);
|
||||
$modules->ensureDefaultModulesProvisioned($organization, $this->ownerRef($request));
|
||||
$result = $modules->sync($organization->fresh(), $this->ownerRef($request), $desired);
|
||||
|
||||
if ($result['errors'] !== []) {
|
||||
return back()->with('error', 'Some modules could not be updated: '.implode(' ', $result['errors']));
|
||||
|
||||
Reference in New Issue
Block a user