Skip to content

Commit

Permalink
clean
Browse files Browse the repository at this point in the history
  • Loading branch information
yurii-github committed Sep 3, 2020
1 parent d241f3d commit 612d73b
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions app/controllers/api/BookController.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public function actionManage()
break;

case 'del':
$this->delete(\Yii::$app->request->post('id'));
Books::findOne(['book_guid' => \Yii::$app->request->post('id')])->delete();
break;

case 'edit':
Expand All @@ -114,16 +114,6 @@ private function add(array $attributes)
$book->insert();
}

/**
* @param string|int $id
* @throws \Throwable
* @throws \yii\db\StaleObjectException
*/
private function delete($id)
{
$book = Books::findOne(['book_guid' => $id]);
$book->delete();
}

private function update($id, $attributes)
{
Expand Down

0 comments on commit 612d73b

Please sign in to comment.