security fix and fix parent pages
API CI/CD / Validate (composer + pint) (push) Successful in 3m7s
API CI/CD / Test (PHPUnit) (push) Failing after 5m46s
API CI/CD / Build frontend assets (push) Successful in 1m2s
API CI/CD / Security audit (push) Failing after 49s
API CI/CD / Deploy to shared hosting (PHP) (push) Has been skipped
API CI/CD / Validate (composer + pint) (push) Successful in 3m7s
API CI/CD / Test (PHPUnit) (push) Failing after 5m46s
API CI/CD / Build frontend assets (push) Successful in 1m2s
API CI/CD / Security audit (push) Failing after 49s
API CI/CD / Deploy to shared hosting (PHP) (push) Has been skipped
This commit is contained in:
@@ -8,6 +8,7 @@ use App\Http\Requests\Staff\StaffStoreRequest;
|
||||
use App\Http\Requests\Staff\StaffUpdateRequest;
|
||||
use App\Http\Resources\Staff\StaffCollection;
|
||||
use App\Http\Resources\Staff\StaffResource;
|
||||
use App\Models\Role;
|
||||
use App\Models\Staff;
|
||||
use App\Models\User;
|
||||
use App\Services\Staff\StaffCommandService;
|
||||
@@ -45,6 +46,24 @@ class StaffController extends BaseApiController
|
||||
]);
|
||||
}
|
||||
|
||||
public function formOptions(): JsonResponse
|
||||
{
|
||||
$roles = Role::query()
|
||||
->select('id', 'name')
|
||||
->orderBy('priority')
|
||||
->orderBy('name')
|
||||
->get()
|
||||
->map(fn (Role $role) => [
|
||||
'id' => (int) $role->id,
|
||||
'name' => (string) $role->name,
|
||||
])
|
||||
->all();
|
||||
|
||||
return $this->success([
|
||||
'roles' => $roles,
|
||||
]);
|
||||
}
|
||||
|
||||
public function show(int $id): JsonResponse
|
||||
{
|
||||
$staff = $this->queryService->find($id);
|
||||
|
||||
Reference in New Issue
Block a user