Interface SAV

This commit is contained in:
Jonathan Chevalier
2023-07-18 16:57:24 +02:00
parent 6a98b61f51
commit df95e2b876
2 changed files with 41 additions and 7 deletions

View File

@@ -45,7 +45,7 @@ export default {
return response.json();
},
async saveMessage(id, quill, replyOption) {
async saveMessage(id, quill, attachedDoc, replyOption) {
const apiUrl = '/App/api.php?prj=pharmamp&controller=TicketingController&method=saveMessage'
if (import.meta.env.DEV) {
console.log(apiUrl)
@@ -54,6 +54,13 @@ export default {
const postData = new FormData();
postData.append("id_business", id);
postData.append("quill", quill);
if (attachedDoc !== null) {
for (const file of attachedDoc.files) {
postData.append('attached_doc', file, file.name)
}
}
postData.append("data", JSON.stringify(replyOption));
const response = await fetch(apiUrl, {