Done: requests

This commit is contained in:
Jose
2026-01-30 16:50:56 +01:00
parent 665ac85701
commit f7070fd91a
12 changed files with 75 additions and 95 deletions

View File

@@ -62,24 +62,6 @@ export const useData = (config) => {
return response.data;
};
const postDataValidated = async (endpoint, payload) => {
try {
const response = await axios.post(endpoint, payload, {
headers: {
Authorization: `Bearer ${localStorage.getItem("token")}`,
"Content-Type": "application/json",
},
});
return { ok: true };
} catch (err) {
return {
ok: false,
errors: err.response?.data?.errors || {}
};
}
};
const putData = async (endpoint, payload) => {
const response = await axios.put(endpoint, payload, {
headers: getAuthHeaders(),
@@ -111,7 +93,6 @@ export const useData = (config) => {
dataError,
getData,
postData,
postDataValidated,
putData,
deleteData,
deleteDataWithBody,