From acd50c31e46af570146b025e38b55736ea28f51f Mon Sep 17 00:00:00 2001 From: Azat Kashapov Date: Thu, 19 Oct 2023 19:05:06 +0200 Subject: [PATCH] Update TagController.php --- modules/api/controllers/TagController.php | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/modules/api/controllers/TagController.php b/modules/api/controllers/TagController.php index 5a86d81..20bb62c 100644 --- a/modules/api/controllers/TagController.php +++ b/modules/api/controllers/TagController.php @@ -68,41 +68,37 @@ public function actionView($id) { /** * Creates a new Tag model. * If creation is successful, the browser will be redirected to the 'view' page. - * @return string|\yii\web\Response + * @return Tag */ public function actionCreate() { $model = new Tag(); if ($this->request->isPost) { if ($model->load($this->request->post()) && $model->save()) { - return $this->redirect(['view', 'id' => $model->id]); + return $model; } } else { $model->loadDefaultValues(); } - return $this->render('create', [ - 'model' => $model, - ]); + return $model; } /** * Updates an existing Tag model. * If update is successful, the browser will be redirected to the 'view' page. * @param int $id ID - * @return string|\yii\web\Response + * @return Tag * @throws NotFoundHttpException if the model cannot be found */ public function actionUpdate($id) { $model = $this->findModel($id); if ($this->request->isPost && $model->load($this->request->post()) && $model->save()) { - return $this->redirect(['view', 'id' => $model->id]); + return $model; } - return $this->render('update', [ - 'model' => $model, - ]); + return $model; } /**