From b24125ac6639069fa98dac7ab773ed94b7ce66ed Mon Sep 17 00:00:00 2001 From: Kavalar Date: Wed, 19 Apr 2023 23:44:52 +0300 Subject: [PATCH] fix cors --- ...user_card_id_column_from_manager_table.php | 23 +++++++++++++++++++ .../modules/api/controllers/ApiController.php | 3 ++- .../api/controllers/RequestController.php | 3 +-- 3 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 console/migrations/m230419_100612_drop_user_card_id_column_from_manager_table.php diff --git a/console/migrations/m230419_100612_drop_user_card_id_column_from_manager_table.php b/console/migrations/m230419_100612_drop_user_card_id_column_from_manager_table.php new file mode 100644 index 0000000..20d43b6 --- /dev/null +++ b/console/migrations/m230419_100612_drop_user_card_id_column_from_manager_table.php @@ -0,0 +1,23 @@ + GsCors::class, 'cors' => [ 'Origin' => ['*'], + 'Access-Control-Request-Methods' => ['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS'], //'Access-Control-Allow-Credentials' => true, 'Access-Control-Allow-Headers' => [ 'Access-Control-Allow-Origin', diff --git a/frontend/modules/api/controllers/RequestController.php b/frontend/modules/api/controllers/RequestController.php index 3426d6e..3845547 100644 --- a/frontend/modules/api/controllers/RequestController.php +++ b/frontend/modules/api/controllers/RequestController.php @@ -330,8 +330,7 @@ class RequestController extends ApiController $put = array_diff(\Yii::$app->request->getBodyParams(), [null, '']); - $requestService->load($put, '') - ->save(); + $requestService->load($put, '')->save(); if (!$requestService->isSave) { throw new BadRequestHttpException(json_encode($requestService->errors));