Interface SAV
This commit is contained in:
@@ -18,7 +18,7 @@ export default {
|
||||
async getMessages(code, id) {
|
||||
// code =2641056
|
||||
// id = 66088
|
||||
const apiUrl = '/App/api.php?prj=pharmamp&controller=TicketingController&method=getMessages&code_business='+code + '&id_business='+id
|
||||
const apiUrl = '/App/api.php?prj=pharmamp&controller=TicketingController&method=getMessages&code_business=' + code + '&id_business=' + id
|
||||
|
||||
if (import.meta.env.DEV) {
|
||||
console.log(apiUrl)
|
||||
@@ -31,5 +31,26 @@ export default {
|
||||
}
|
||||
|
||||
return response.json();
|
||||
}
|
||||
},
|
||||
async saveMessage(id, reply) {
|
||||
const apiUrl = '/App/api.php?prj=pharmamp&controller=TicketingController&method=saveMessage'
|
||||
if (import.meta.env.DEV) {
|
||||
console.log(apiUrl)
|
||||
}
|
||||
|
||||
const postData = new FormData();
|
||||
postData.append("id_business", id);
|
||||
postData.append("data", JSON.stringify(reply));
|
||||
|
||||
const response = await fetch(apiUrl, {
|
||||
method: 'POST',
|
||||
body: postData
|
||||
});
|
||||
|
||||
if (import.meta.env.DEV) {
|
||||
console.log(response.clone().text())
|
||||
}
|
||||
|
||||
return response.json();
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user