eleven-solutions-common-website-unique-web 9.0.43 → 9.0.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -2,6 +2,4 @@ export declare const addTemplateApi: (name: string, content: string) => Promise<
|
|
|
2
2
|
export declare const fetchTemplatesApi: () => Promise<unknown>;
|
|
3
3
|
export declare const fetchTemplateByIdApi: (id: string) => Promise<unknown>;
|
|
4
4
|
export declare const updateTemplateApi: (id: string, name: string, content: string) => Promise<unknown>;
|
|
5
|
-
export declare const deleteTemplateApi: (id: string) => Promise<
|
|
6
|
-
id: string;
|
|
7
|
-
}>;
|
|
5
|
+
export declare const deleteTemplateApi: (id: string) => Promise<unknown>;
|
|
@@ -78,24 +78,39 @@ export const updateTemplateApi = (id, name, content) => __awaiter(void 0, void 0
|
|
|
78
78
|
throw error;
|
|
79
79
|
}
|
|
80
80
|
});
|
|
81
|
+
// export const deleteTemplateApi = async (id: string) => {
|
|
82
|
+
// const token = cookies.get("token");
|
|
83
|
+
// try {
|
|
84
|
+
// const response = await axios.request({
|
|
85
|
+
// method: "PATCH",
|
|
86
|
+
// url: `${apiUrl}/template/deletetemplate`,
|
|
87
|
+
// headers: {
|
|
88
|
+
// Authorization: `Bearer ${token}`,
|
|
89
|
+
// "Content-Type": "application/json",
|
|
90
|
+
// },
|
|
91
|
+
// data: {
|
|
92
|
+
// id,
|
|
93
|
+
// },
|
|
94
|
+
// });
|
|
95
|
+
// return response.data;
|
|
96
|
+
// } catch (error) {
|
|
97
|
+
// console.error("Error updating template:", error);
|
|
98
|
+
// throw error;
|
|
99
|
+
// }
|
|
100
|
+
// };
|
|
81
101
|
export const deleteTemplateApi = (id) => __awaiter(void 0, void 0, void 0, function* () {
|
|
82
102
|
const token = cookies.get("token");
|
|
83
103
|
try {
|
|
84
|
-
const response = yield axios.
|
|
85
|
-
|
|
86
|
-
|
|
104
|
+
const response = yield axios.post(`${apiUrl}/template/deletetemplate`, {
|
|
105
|
+
id: id,
|
|
106
|
+
}, {
|
|
87
107
|
headers: {
|
|
88
108
|
Authorization: `Bearer ${token}`,
|
|
89
|
-
"Content-Type": "application/json",
|
|
90
|
-
},
|
|
91
|
-
data: {
|
|
92
|
-
id,
|
|
93
109
|
},
|
|
94
110
|
});
|
|
95
111
|
return response.data;
|
|
96
112
|
}
|
|
97
113
|
catch (error) {
|
|
98
|
-
console.error("Error updating template:", error);
|
|
99
114
|
throw error;
|
|
100
115
|
}
|
|
101
116
|
});
|
package/package.json
CHANGED
|
@@ -90,24 +90,45 @@ export const updateTemplateApi = async (
|
|
|
90
90
|
}
|
|
91
91
|
};
|
|
92
92
|
|
|
93
|
+
// export const deleteTemplateApi = async (id: string) => {
|
|
94
|
+
// const token = cookies.get("token");
|
|
95
|
+
|
|
96
|
+
// try {
|
|
97
|
+
// const response = await axios.request({
|
|
98
|
+
// method: "PATCH",
|
|
99
|
+
// url: `${apiUrl}/template/deletetemplate`,
|
|
100
|
+
// headers: {
|
|
101
|
+
// Authorization: `Bearer ${token}`,
|
|
102
|
+
// "Content-Type": "application/json",
|
|
103
|
+
// },
|
|
104
|
+
// data: {
|
|
105
|
+
// id,
|
|
106
|
+
// },
|
|
107
|
+
// });
|
|
108
|
+
// return response.data;
|
|
109
|
+
// } catch (error) {
|
|
110
|
+
// console.error("Error updating template:", error);
|
|
111
|
+
// throw error;
|
|
112
|
+
// }
|
|
113
|
+
// };
|
|
114
|
+
|
|
93
115
|
export const deleteTemplateApi = async (id: string) => {
|
|
94
116
|
const token = cookies.get("token");
|
|
95
117
|
|
|
96
118
|
try {
|
|
97
|
-
const response = await axios.
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
Authorization: `Bearer ${token}`,
|
|
102
|
-
"Content-Type": "application/json",
|
|
103
|
-
},
|
|
104
|
-
data: {
|
|
105
|
-
id,
|
|
119
|
+
const response = await axios.post(
|
|
120
|
+
`${apiUrl}/template/deletetemplate`,
|
|
121
|
+
{
|
|
122
|
+
id: id,
|
|
106
123
|
},
|
|
107
|
-
|
|
124
|
+
{
|
|
125
|
+
headers: {
|
|
126
|
+
Authorization: `Bearer ${token}`,
|
|
127
|
+
},
|
|
128
|
+
}
|
|
129
|
+
);
|
|
108
130
|
return response.data;
|
|
109
131
|
} catch (error) {
|
|
110
|
-
console.error("Error updating template:", error);
|
|
111
132
|
throw error;
|
|
112
133
|
}
|
|
113
134
|
};
|