eleven-solutions-common-website-unique-web 9.0.49 → 9.0.50
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.
|
@@ -12,7 +12,7 @@ import Cookies from "universal-cookie";
|
|
|
12
12
|
const apiUrl = "http://localhost:5260";
|
|
13
13
|
const cookies = new Cookies();
|
|
14
14
|
export const addTemplateApi = (name, content) => __awaiter(void 0, void 0, void 0, function* () {
|
|
15
|
-
const token = cookies.get("
|
|
15
|
+
const token = cookies.get("authToken");
|
|
16
16
|
try {
|
|
17
17
|
const response = yield axios.post(`${apiUrl}/template/add`, {
|
|
18
18
|
Name: name,
|
|
@@ -78,26 +78,6 @@ 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
|
-
// };
|
|
101
81
|
export const deleteTemplateApi = (id) => __awaiter(void 0, void 0, void 0, function* () {
|
|
102
82
|
const token = cookies.get("token");
|
|
103
83
|
try {
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@ const apiUrl = "http://localhost:5260";
|
|
|
4
4
|
const cookies = new Cookies();
|
|
5
5
|
|
|
6
6
|
export const addTemplateApi = async (name: string, content: string) => {
|
|
7
|
-
const token = cookies.get("
|
|
7
|
+
const token = cookies.get("authToken");
|
|
8
8
|
|
|
9
9
|
try {
|
|
10
10
|
const response = await axios.post(
|
|
@@ -90,28 +90,6 @@ 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
|
-
|
|
115
93
|
export const deleteTemplateApi = async (id: string) => {
|
|
116
94
|
const token = cookies.get("token");
|
|
117
95
|
|