eleven-solutions-common-website-unique-web 4.0.17 → 4.0.18
Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,8 @@
|
|
1
1
|
export declare const addTaxonomyApi: (type: string, code: number, value: string) => Promise<Axios.AxiosXHR<unknown>>;
|
2
2
|
export declare const fetchTaxonomiessApi: () => Promise<unknown>;
|
3
|
-
export declare const deleteTaxonomyApi: (id: string) => Promise<
|
3
|
+
export declare const deleteTaxonomyApi: (id: string) => Promise<{
|
4
|
+
id: string;
|
5
|
+
}>;
|
4
6
|
export declare const fetchTaxonomyByIdApi: (taxonomyId: string) => Promise<unknown>;
|
5
7
|
export declare const updateTaxonomyApi: (id: string, type: string, code: number, value: string) => Promise<unknown>;
|
6
8
|
export declare const addMultipleTaxonomiesApi: (taxonomies: {
|
@@ -48,21 +48,33 @@ export const fetchTaxonomiessApi = () => __awaiter(void 0, void 0, void 0, funct
|
|
48
48
|
export const deleteTaxonomyApi = (id) => __awaiter(void 0, void 0, void 0, function* () {
|
49
49
|
const token = cookies.get("token");
|
50
50
|
try {
|
51
|
-
const response =
|
51
|
+
// const response = await axios.delete(`${apiUrl}/taxonomy/delete`, {
|
52
|
+
// headers: {
|
53
|
+
// Authorization: `Bearer ${token}`,
|
54
|
+
// },
|
55
|
+
// // data: {
|
56
|
+
// // id,
|
57
|
+
// // },
|
58
|
+
// params: {
|
59
|
+
// id,
|
60
|
+
// },
|
61
|
+
// });
|
62
|
+
// return response.data;
|
63
|
+
const response = yield axios.request({
|
64
|
+
method: "DELETE",
|
65
|
+
url: `${apiUrl}/taxonomy/delete`,
|
52
66
|
headers: {
|
53
67
|
Authorization: `Bearer ${token}`,
|
68
|
+
"Content-Type": "application/json",
|
54
69
|
},
|
55
|
-
|
56
|
-
// id,
|
57
|
-
// },
|
58
|
-
params: {
|
70
|
+
data: {
|
59
71
|
id,
|
60
72
|
},
|
61
73
|
});
|
62
74
|
return response.data;
|
63
75
|
}
|
64
76
|
catch (error) {
|
65
|
-
console.error("Error deleting
|
77
|
+
console.error("Error deleting taxonomy:", error);
|
66
78
|
throw error;
|
67
79
|
}
|
68
80
|
});
|
package/package.json
CHANGED
@@ -52,20 +52,32 @@ export const deleteTaxonomyApi = async (id: string) => {
|
|
52
52
|
const token = cookies.get("token");
|
53
53
|
|
54
54
|
try {
|
55
|
-
const response = await axios.delete(`${apiUrl}/taxonomy/delete`, {
|
55
|
+
// const response = await axios.delete(`${apiUrl}/taxonomy/delete`, {
|
56
|
+
// headers: {
|
57
|
+
// Authorization: `Bearer ${token}`,
|
58
|
+
// },
|
59
|
+
// // data: {
|
60
|
+
// // id,
|
61
|
+
// // },
|
62
|
+
// params: {
|
63
|
+
// id,
|
64
|
+
// },
|
65
|
+
// });
|
66
|
+
// return response.data;
|
67
|
+
const response = await axios.request({
|
68
|
+
method: "DELETE",
|
69
|
+
url: `${apiUrl}/taxonomy/delete`,
|
56
70
|
headers: {
|
57
71
|
Authorization: `Bearer ${token}`,
|
72
|
+
"Content-Type": "application/json",
|
58
73
|
},
|
59
|
-
|
60
|
-
// id,
|
61
|
-
// },
|
62
|
-
params: {
|
74
|
+
data: {
|
63
75
|
id,
|
64
76
|
},
|
65
77
|
});
|
66
78
|
return response.data;
|
67
79
|
} catch (error) {
|
68
|
-
console.error("Error deleting
|
80
|
+
console.error("Error deleting taxonomy:", error);
|
69
81
|
throw error;
|
70
82
|
}
|
71
83
|
};
|