v0.1.2 - Added edit function

fixed create function
Deleted old update
This commit is contained in:
Anders
2021-06-08 14:08:24 +02:00
parent 2c89fb79f6
commit 576992b365
8 changed files with 67 additions and 71 deletions
+3 -5
View File
@@ -4,14 +4,12 @@ require "../../bootstrap.php";
use Backend\Model\Post;
if(isset($_POST['update'])){
if(isset($_POST['id'])){
$post = Post::query()->find($_POST['id']);
$post->title = $_POST['upTitle'];
$post->description = $_POST['upDescription'];
if(!$post->update()){
echo "Error could not update";
}else{
header("location: ../../Frontend/admin.php");
if($post->update()){
return 1;
}
}