| 3719 |
stevensc |
1 |
import { axios } from '@app/utils';
|
|
|
2 |
|
|
|
3 |
export const replyInmail = async (url, message) => {
|
|
|
4 |
const formData = new FormData();
|
|
|
5 |
Object.entries(message).map(([key, value]) => formData.append(key, value));
|
|
|
6 |
|
|
|
7 |
return axios.post(url, formData).then((response) => {
|
|
|
8 |
const { success, data } = response.data;
|
|
|
9 |
if (!success) throw data;
|
|
|
10 |
return data;
|
|
|
11 |
});
|
|
|
12 |
};
|
|
|
13 |
|
|
|
14 |
export const sendInmail = async (to, message) => {
|
|
|
15 |
const formData = new FormData();
|
|
|
16 |
Object.entries(message).map(([key, value]) => formData.append(key, value));
|
|
|
17 |
|
|
|
18 |
return axios.post(to, formData).then((response) => {
|
|
|
19 |
const { success, data } = response.data;
|
|
|
20 |
if (!success) throw data;
|
|
|
21 |
return data;
|
|
|
22 |
});
|
|
|
23 |
};
|
|
|
24 |
|
|
|
25 |
export const deleteInmail = async (url) => {
|
|
|
26 |
return axios.post(url).then((response) => {
|
|
|
27 |
const { success, data } = response.data;
|
|
|
28 |
if (!success) throw data;
|
|
|
29 |
});
|
|
|
30 |
};
|