fix test issues
API CI/CD / Validate (composer + pint) (push) Successful in 3m30s
API CI/CD / Test (PHPUnit) (push) Failing after 5m4s
API CI/CD / Build frontend assets (push) Successful in 1m1s
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 3m30s
API CI/CD / Test (PHPUnit) (push) Failing after 5m4s
API CI/CD / Build frontend assets (push) Successful in 1m1s
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:
@@ -32,7 +32,6 @@ class RolePermissionController extends BaseApiController
|
||||
private RoleQueryService $queryService,
|
||||
private RoleAssignmentService $assignmentService,
|
||||
private RolePermissionService $permissionService,
|
||||
private RoleCrudService $roleCrudService,
|
||||
private PermissionCrudService $permissionCrudService
|
||||
) {
|
||||
parent::__construct();
|
||||
@@ -68,7 +67,7 @@ class RolePermissionController extends BaseApiController
|
||||
public function storeRole(RoleStoreRequest $request): JsonResponse
|
||||
{
|
||||
try {
|
||||
$role = $this->roleCrudService->create($request->validated());
|
||||
$role = $this->roleCrudService()->create($request->validated());
|
||||
} catch (\Throwable $e) {
|
||||
Log::error('Role store failed: '.$e->getMessage());
|
||||
|
||||
@@ -88,7 +87,7 @@ class RolePermissionController extends BaseApiController
|
||||
}
|
||||
|
||||
try {
|
||||
$role = $this->roleCrudService->update($role, $request->validated());
|
||||
$role = $this->roleCrudService()->update($role, $request->validated());
|
||||
} catch (\Throwable $e) {
|
||||
Log::error('Role update failed: '.$e->getMessage());
|
||||
|
||||
@@ -108,7 +107,7 @@ class RolePermissionController extends BaseApiController
|
||||
}
|
||||
|
||||
try {
|
||||
$this->roleCrudService->delete($role);
|
||||
$this->roleCrudService()->delete($role);
|
||||
} catch (\Throwable $e) {
|
||||
Log::error('Role delete failed: '.$e->getMessage());
|
||||
|
||||
@@ -266,4 +265,9 @@ class RolePermissionController extends BaseApiController
|
||||
|
||||
return $userId;
|
||||
}
|
||||
|
||||
private function roleCrudService(): object
|
||||
{
|
||||
return app(RoleCrudService::class);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user