v0.0.6 Made edit and update now works dynamically

This commit is contained in:
Victor
2021-06-03 12:50:28 +02:00
parent 256f163771
commit 4024c0dd99
9 changed files with 94 additions and 30 deletions
+3 -6
View File
@@ -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";