update error message

This commit is contained in:
Jonas Leder 2022-03-08 11:14:31 +01:00
parent 7e371dac06
commit 5c001a992b
No known key found for this signature in database
GPG key ID: 8A53DD45A7D7B44B

View file

@ -9,8 +9,7 @@ $blogPostFields = new ObjectType([
"title" => Type::string(),
"content" => Type::string(),
"date" => Type::string(),
"id" => Type::string(),
"error" => Type::string(),
"id" => Type::string()
],
]);
@ -22,7 +21,10 @@ function blogPost($id, $conn)
$row = $result->fetch_assoc();
} else {
return [
"error" => "Post not found"
"title" => "Nicht Gefunden",
"content" => "Post wurde nicht gefunden",
"date" => "2000-01-01 00:00:00",
"id" => "-1"
];
}
@ -35,7 +37,6 @@ function blogPost($id, $conn)
"title" => $title,
"content" => $content,
"date" => $date,
"id" => $id,
"error" => ""
"id" => $id
];
}