Skip to content

Commit

Permalink
added api/new_post.php
Browse files Browse the repository at this point in the history
  • Loading branch information
judemont committed Feb 12, 2024
1 parent fc66b64 commit a0d1a04
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions api/new_post.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php
header('Content-type: application/json');

include_once("utils/newPost.php");

$content = $_POST["postContent"];

echo json_encode(newPost($content));
?>
2 changes: 1 addition & 1 deletion front/src/scripts/sendNewPost.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export async function sendNewPost(postContent: string, postImageFile: File|null)

}

const response = await fetch(`api/newPost.php`, {
const response = await fetch(`api/new_post.php`, {
method: "POST",
body: formData,
credentials: "include"
Expand Down

0 comments on commit a0d1a04

Please sign in to comment.