feat: update delete axiosDise

This commit is contained in:
hanif salafi 2024-11-04 08:29:51 +07:00
parent ab0f6282f0
commit afec24a759
1 changed files with 0 additions and 70 deletions

View File

@ -1,70 +0,0 @@
import axiosDisestagesInstance2 from "./axios-disestages-instance-2";
export async function httpPostDisestages(pathUrl: any, headers: any, data?: any) {
const response = await axiosDisestagesInstance2
.post(pathUrl, data, { headers })
.catch(function (error) {
console.log(error);
return error.response;
});
console.log("Response base svc : ", response);
if (response?.status == 200 || response?.status == 201) {
return {
error: false,
message: "success",
data: response?.data,
};
} else {
return {
error: true,
message: response?.data?.message || response?.data || null,
data: null,
};
}
}
export async function httpGetDisestages(pathUrl: any, headers: any) {
const response = await axiosDisestagesInstance2
.get(pathUrl, { headers })
.catch(function (error) {
console.log(error);
return error.response;
});
console.log("Response base svc : ", response);
if (response?.status == 200 || response?.status == 201) {
return {
error: false,
message: "success",
data: response?.data,
};
} else {
return {
error: true,
message: response?.data?.message || response?.data || null,
data: null,
};
}
}
// export async function httpDelete(pathUrl: any) {
// const response = await axiosDisestagesInstance
// .delete(pathUrl, data, { headers })
// .catch(function (error) {
// console.log(error);
// return error.response;
// });
// console.log("Response base svc : ", response);
// if (response?.status == 200 || response?.status == 201) {
// return {
// error: false,
// message: "success",
// data: response?.data,
// };
// } else {
// return {
// error: true,
// message: response?.data?.message || response?.data || null,
// data: null,
// };
// }
// }