false, 'message' => 'Некорректный photo_id'], 400); } $photo = photoById($photoId); if (!$photo) { adminJsonResponse(['ok' => false, 'message' => 'Фото не найдено'], 404); } adminJsonResponse([ 'ok' => true, 'photo' => ['id' => (int)$photo['id'], 'code_name' => (string)$photo['code_name']], 'comments' => commentsByPhoto($photoId), ]); }