feat: update delete axiosDise
This commit is contained in:
parent
ab0f6282f0
commit
afec24a759
|
|
@ -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,
|
|
||||||
// };
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
Loading…
Reference in New Issue