bugfix
This commit is contained in:
parent
8fc6ab8e6a
commit
665bd7a18a
|
@ -40,10 +40,10 @@ const handlePostData = async (req: Request, res: Response, next: NextFunction):
|
||||||
post.message = newFilename;
|
post.message = newFilename;
|
||||||
post.type = 1;
|
post.type = 1;
|
||||||
} else {
|
} else {
|
||||||
if (!post.message) {
|
// if (!post.message) {
|
||||||
res.status(400).send("Post message is not specified");
|
// res.status(400).send("Post message is not specified");
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
post.type = 0;
|
post.type = 0;
|
||||||
post.message = message;
|
post.message = message;
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,6 +43,7 @@ function PostActions() {
|
||||||
if (!isMedia) {
|
if (!isMedia) {
|
||||||
headers = { "Content-Type": "application/json" }
|
headers = { "Content-Type": "application/json" }
|
||||||
}
|
}
|
||||||
|
|
||||||
await fetch(`/api/v1/post/${isUpdating ? `update/${toUpdate}` : "create"}`, {
|
await fetch(`/api/v1/post/${isUpdating ? `update/${toUpdate}` : "create"}`, {
|
||||||
method: isUpdating ? "PUT" : "POST",
|
method: isUpdating ? "PUT" : "POST",
|
||||||
headers,
|
headers,
|
||||||
|
@ -78,7 +79,6 @@ function PostActions() {
|
||||||
|
|
||||||
) : (
|
) : (
|
||||||
<input placeholder="Текст поста" type="text" className="beautiful_input" id="textInput" defaultValue={oldPost.message} style={isMedia ? ({ display: "none" }) : ({ display: "block" })}></input>
|
<input placeholder="Текст поста" type="text" className="beautiful_input" id="textInput" defaultValue={oldPost.message} style={isMedia ? ({ display: "none" }) : ({ display: "block" })}></input>
|
||||||
|
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
|
|
Loading…
Reference in New Issue