Updated comments creation request

This commit is contained in:
Pierre HUBERT 2018-07-03 12:32:44 +02:00
parent 2b8a7f08cb
commit a3ddd525d0

View File

@ -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