v0.0.6 Made edit and update now works dynamically
This commit is contained in:
@@ -5,12 +5,9 @@ require "../../bootstrap.php";
|
||||
use Backend\Model\Post;
|
||||
|
||||
if(isset($_POST['update'])){
|
||||
$id = $_POST['id'];
|
||||
$title = $_POST['upTitle'];
|
||||
$description = $_POST['upDescription'];
|
||||
$post = Post::query()->find($id)->first();
|
||||
$post->title = $title;
|
||||
$post->description = $description;
|
||||
$post = Post::query()->find($_POST['id']);
|
||||
$post->title = $_POST['upTitle'];
|
||||
$post->description = $_POST['upDescription'];
|
||||
|
||||
if(!$post->update()){
|
||||
echo "Error could not update";
|
||||
|
||||
Reference in New Issue
Block a user