add tests batch 20
This commit is contained in:
@@ -124,12 +124,12 @@ class TeacherController extends BaseApiController
|
||||
|
||||
private function teacherPayload(?array $teacher, int $userId): ?array
|
||||
{
|
||||
if (! $teacher) {
|
||||
if (!$teacher) {
|
||||
$model = User::query()->find($userId);
|
||||
$teacher = $model?->toArray();
|
||||
}
|
||||
|
||||
if (! $teacher) {
|
||||
if (!$teacher) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -142,6 +142,9 @@ class TeacherController extends BaseApiController
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int|JsonResponse
|
||||
*/
|
||||
private function authenticatedUserIdOrUnauthorized(): int|JsonResponse
|
||||
{
|
||||
$userId = (int) (auth()->id() ?? 0);
|
||||
|
||||
Reference in New Issue
Block a user