rollback actionIndex in ProfileController

This commit is contained in:
iIronside 2022-10-19 15:42:26 +03:00
parent 6385787702
commit f41b1615a5

View File

@ -10,13 +10,6 @@ use yii\web\ServerErrorHttpException;
class ProfileController extends ApiController class ProfileController extends ApiController
{ {
// public function verbs(): array
// {
// return [
// '' => ['get'],
// 'profile-with-report-permission' => ['post', 'patch']
// ];
// }
public function behaviors(): array public function behaviors(): array
{ {
@ -38,11 +31,7 @@ class ProfileController extends ApiController
*/ */
public function actionIndex($id = null): ?array public function actionIndex($id = null): ?array
{ {
$profiles = ProfileService::getProfile($id, \Yii::$app->request->get()); return ProfileService::getProfile($id, \Yii::$app->request->get());
if(empty($profiles)) {
throw new NotFoundHttpException('Profiles not found');
}
return $profiles;
} }
/** /**