mirror of
https://github.com/pierre42100/ComunicWeb
synced 2024-11-25 13:29:22 +00:00
Updated comments creation request
This commit is contained in:
parent
2b8a7f08cb
commit
a3ddd525d0
@ -124,8 +124,15 @@ ComunicWeb.components.comments.form = {
|
|||||||
//Lock send button
|
//Lock send button
|
||||||
sendButton.disabled = true;
|
sendButton.disabled = true;
|
||||||
|
|
||||||
//Try to create the comment
|
//Prepare the request
|
||||||
var formData = new FormData(commentForm);
|
var formData = new FormData();
|
||||||
|
formData.append("content", newCommentText.value);
|
||||||
|
|
||||||
|
//Check for image
|
||||||
|
if(imageFile.files.length > 0)
|
||||||
|
formData.append("image", imageFile.files[0], imageFile.files[0].name);
|
||||||
|
|
||||||
|
//Send the request
|
||||||
ComunicWeb.components.comments.interface.create(postID, formData, function(result){
|
ComunicWeb.components.comments.interface.create(postID, formData, function(result){
|
||||||
|
|
||||||
//Unlock send button
|
//Unlock send button
|
||||||
|
Loading…
Reference in New Issue
Block a user