This commit is contained in:
andrey 2022-03-03 17:24:45 +03:00
parent 4cbb004c4d
commit daee4e3e68
5 changed files with 15 additions and 15 deletions

View File

@ -173,7 +173,7 @@ class UserQuestionnaire extends ActiveRecord
*/
public static function getQuestionnaireId($uuid)
{
return ArrayHelper::getValue(self::find()->where(['uuid' => $uuid])->one(), 'id');
return ArrayHelper::getValue(self::find()->where(['uuid' => $uuid])->one(), 'questionnaire_id');
}
public static function findActiveUserQuestionnaires($user_id): array

View File

@ -8,18 +8,18 @@ use yii\filters\auth\HttpBearerAuth;
use yii\web\NotFoundHttpException;
use yii\rest\Controller;
class AnswerController extends Controller
class AnswerController extends ApiController
{
public function behaviors(): array
{
$behaviors = parent::behaviors();
$behaviors['authenticator']['authMethods'] = [
HttpBearerAuth::className(),
];
return $behaviors;
}
// public function behaviors(): array
// {
// $behaviors = parent::behaviors();
//
// $behaviors['authenticator']['authMethods'] = [
// HttpBearerAuth::className(),
// ];
//
// return $behaviors;
// }
public function verbs(): array
{

View File

@ -10,7 +10,7 @@ use yii\filters\auth\HttpBearerAuth;
use yii\rest\Controller;
use yii\web\NotFoundHttpException;
class QuestionController extends Controller
class QuestionController extends ApiController
{
public function behaviors()
{

View File

@ -48,7 +48,7 @@ class UserController extends ActiveController
'X-Requested-With'
],
]
]
],
]);
}

View File

@ -8,7 +8,7 @@ use yii\filters\auth\HttpBearerAuth;
use yii\rest\Controller;
use yii\web\NotFoundHttpException;
class UserQuestionnaireController extends Controller
class UserQuestionnaireController extends ApiController
{
public function behaviors()
{