Начат запил страницы отображающей пост

This commit is contained in:
2024-04-27 20:47:41 +03:00
parent 62b7b68976
commit e538a76b09
9 changed files with 237 additions and 17 deletions

View File

@@ -186,7 +186,7 @@ function Post_Create (
if ($s->execute() === false)
return new ReturnT(err_code: E_DBE_INSERTFAIL, err_desc: "failed to create post record in DB");
$result = true;
$result = $db->insert_id;
return new ReturnT(data: $result);
}
@@ -199,10 +199,12 @@ function Post_Create (
* METHOD
* Create single publication
* Request fields:
* tags - list of tags, should be delimited by comma
* tags - list of tags, should be delimited by comma
* title - optional title for post
* Files fields:
* pic - id of file object in $_FILES variable
* pic - id of file object in $_FILES variable
* Return value:
* id - unique identifier of created post
*/
function Post_Create_Method (array $req, array $files): ReturnT {
global $Config, $LOGGED_IN, $THIS_USER;
@@ -341,7 +343,7 @@ if (Utils_ThisFileIsRequested(__FILE__)) {
if ($result->IsError())
$result->ThrowJSONError();
else
JSON_ReturnData(["success" => $result->GetData()]);
JSON_ReturnData(["id" => $result->GetData()]);
}
?>