the method was moved UserCard to Profile

This commit is contained in:
iironside
2022-03-21 19:08:39 +03:00
parent d11deb20af
commit 16db7b42d9
5 changed files with 143 additions and 54 deletions

View File

@ -4,6 +4,7 @@ namespace frontend\modules\api\controllers;
use common\services\ProfileService;
use yii\web\BadRequestHttpException;
use yii\web\ServerErrorHttpException;
class ProfileController extends ApiController
{
@ -15,7 +16,7 @@ class ProfileController extends ApiController
];
}
public function actionIndex($id = null)
public function actionIndex($id = null): ?array
{
return ProfileService::getProfile($id, \Yii::$app->request->get());
}
@ -27,4 +28,12 @@ class ProfileController extends ApiController
{
return ProfileService::getProfileWithReportPermission($id);
}
/**
* @throws ServerErrorHttpException
*/
public function actionGetMainData($user_id): array
{
return ProfileService::getMainData($user_id);
}
}

View File

@ -1,24 +0,0 @@
<?php
namespace frontend\modules\api\controllers;
use common\services\UserCardService;
use yii\web\ServerErrorHttpException;
class UserCardController extends ApiController
{
public function verbs(): array
{
return [
'get-user-card' => ['get'],
];
}
/**
* @throws ServerErrorHttpException
*/
public function actionGetUserCard($user_id): array
{
return UserCardService::getUserCard($user_id);
}
}