Added function to deactivate post
This commit is contained in:
@@ -74,9 +74,19 @@ class Posts
|
||||
$table = 'pengumuman';
|
||||
$id = $args['id'];
|
||||
unset($args['id']);
|
||||
if ($this->model->update($table, $args, $id)) {
|
||||
if ($this->post->update($table, $args, $id)) {
|
||||
Session::flash('info', 'Data successfuly updated');
|
||||
return $this->index();
|
||||
return $this->edit();
|
||||
}
|
||||
}
|
||||
|
||||
public function delete($args = [])
|
||||
{
|
||||
$table = 'pengumuman';
|
||||
$id = $args['id'];
|
||||
if ($this->post->delete($table, $id)) {
|
||||
Session::flash('info', 'Data successfuly removed');
|
||||
return \Core\Redirect::to('/');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user