eleven-solutions-common-website-unique-web 9.0.48 → 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.
@@ -14,13 +14,12 @@ import JoditEditor from "jodit-react";
14
14
  const TemplateForm = () => {
15
15
  const [name, setName] = useState("");
16
16
  const [content, setContent] = useState("");
17
- // const [placeholder, setPlaceholder] = React.useState("");
18
17
  const placeholder = "";
19
18
  const [isEditMode, setIsEditMode] = useState(false);
20
19
  const editor = useRef(null);
21
20
  const config = useMemo(() => ({
22
21
  readonly: false,
23
- placeholder: placeholder || "Start typing...",
22
+ placeholder: placeholder || "",
24
23
  }), [placeholder]);
25
24
  const validateForm = () => {
26
25
  if (!name || !content) {
@@ -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("token");
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eleven-solutions-common-website-unique-web",
3
- "version": "9.0.48",
3
+ "version": "9.0.50",
4
4
  "main": "./dist/index.js",
5
5
  "scripts": {
6
6
  "build": "tsc",
@@ -9,7 +9,6 @@ import JoditEditor from "jodit-react";
9
9
  const TemplateForm = () => {
10
10
  const [name, setName] = useState("");
11
11
  const [content, setContent] = useState("");
12
- // const [placeholder, setPlaceholder] = React.useState("");
13
12
  const placeholder = "";
14
13
 
15
14
  const [isEditMode, setIsEditMode] = useState<boolean>(false);
@@ -18,7 +17,7 @@ const TemplateForm = () => {
18
17
  const config: Record<string, any> = useMemo(
19
18
  () => ({
20
19
  readonly: false,
21
- placeholder: placeholder || "Start typing...",
20
+ placeholder: placeholder || "",
22
21
  }),
23
22
  [placeholder]
24
23
  );
@@ -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("token");
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