eleven-solutions-common-website-unique-web 9.0.49 → 9.0.51
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,
|
|
@@ -30,7 +30,7 @@ export const addTemplateApi = (name, content) => __awaiter(void 0, void 0, void
|
|
|
30
30
|
}
|
|
31
31
|
});
|
|
32
32
|
export const fetchTemplatesApi = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
33
|
-
const token = cookies.get("
|
|
33
|
+
const token = cookies.get("authToken");
|
|
34
34
|
try {
|
|
35
35
|
const response = yield axios.get(`${apiUrl}/template/gettemplate`, {
|
|
36
36
|
headers: {
|
|
@@ -46,7 +46,7 @@ export const fetchTemplatesApi = () => __awaiter(void 0, void 0, void 0, functio
|
|
|
46
46
|
});
|
|
47
47
|
export const fetchTemplateByIdApi = (id) => __awaiter(void 0, void 0, void 0, function* () {
|
|
48
48
|
const cookies = new Cookies();
|
|
49
|
-
const token = cookies.get("
|
|
49
|
+
const token = cookies.get("authToken");
|
|
50
50
|
try {
|
|
51
51
|
const response = yield axios.get(`${apiUrl}/template/gettemplatebyid/${id}`, {
|
|
52
52
|
headers: {
|
|
@@ -61,7 +61,7 @@ export const fetchTemplateByIdApi = (id) => __awaiter(void 0, void 0, void 0, fu
|
|
|
61
61
|
}
|
|
62
62
|
});
|
|
63
63
|
export const updateTemplateApi = (id, name, content) => __awaiter(void 0, void 0, void 0, function* () {
|
|
64
|
-
const token = cookies.get("
|
|
64
|
+
const token = cookies.get("authToken");
|
|
65
65
|
try {
|
|
66
66
|
const response = yield axios.post(`${apiUrl}/template/updatetemplate`, {
|
|
67
67
|
id: id,
|
|
@@ -78,28 +78,8 @@ 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
|
-
const token = cookies.get("
|
|
82
|
+
const token = cookies.get("authToken");
|
|
103
83
|
try {
|
|
104
84
|
const response = yield axios.post(`${apiUrl}/template/deletetemplate`, {
|
|
105
85
|
id: id,
|
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(
|
|
@@ -27,7 +27,7 @@ export const addTemplateApi = async (name: string, content: string) => {
|
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
export const fetchTemplatesApi = async () => {
|
|
30
|
-
const token = cookies.get("
|
|
30
|
+
const token = cookies.get("authToken");
|
|
31
31
|
|
|
32
32
|
try {
|
|
33
33
|
const response = await axios.get(`${apiUrl}/template/gettemplate`, {
|
|
@@ -44,7 +44,7 @@ export const fetchTemplatesApi = async () => {
|
|
|
44
44
|
|
|
45
45
|
export const fetchTemplateByIdApi = async (id: string) => {
|
|
46
46
|
const cookies = new Cookies();
|
|
47
|
-
const token = cookies.get("
|
|
47
|
+
const token = cookies.get("authToken");
|
|
48
48
|
|
|
49
49
|
try {
|
|
50
50
|
const response = await axios.get(
|
|
@@ -68,7 +68,7 @@ export const updateTemplateApi = async (
|
|
|
68
68
|
name: string,
|
|
69
69
|
content: string
|
|
70
70
|
) => {
|
|
71
|
-
const token = cookies.get("
|
|
71
|
+
const token = cookies.get("authToken");
|
|
72
72
|
|
|
73
73
|
try {
|
|
74
74
|
const response = await axios.post(
|
|
@@ -90,30 +90,8 @@ 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
|
-
const token = cookies.get("
|
|
94
|
+
const token = cookies.get("authToken");
|
|
117
95
|
|
|
118
96
|
try {
|
|
119
97
|
const response = await axios.post(
|