eleven-solutions-common-website-unique-web 3.0.16 → 3.0.18

Sign up to get free protection for your applications and to get access to all the features.
@@ -131,7 +131,8 @@ const TaxonomyForm = () => {
131
131
  }
132
132
  });
133
133
  fetchIsMultiple();
134
- }, [type]);
134
+ // }, [type]);
135
+ }, []);
135
136
  const handleCancelClick = () => {
136
137
  setType("");
137
138
  setCode("");
@@ -1,5 +1,7 @@
1
1
  export declare const addUserApi: (name: string, email: string, mobile: string, address: string, roleType: string) => Promise<Axios.AxiosXHR<unknown>>;
2
2
  export declare const fetchUsersApi: () => Promise<unknown>;
3
3
  export declare const fetchUserByIdApi: (userId: string) => Promise<unknown>;
4
- export declare const deleteUserApi: (id: string) => Promise<unknown>;
4
+ export declare const deleteUserApi: (id: string) => Promise<{
5
+ id: string;
6
+ }>;
5
7
  export declare const updateUserApi: (id: string, name: string, mobile: string, address: string, roleType: string) => Promise<unknown>;
@@ -66,22 +66,21 @@ export const fetchUserByIdApi = (userId) => __awaiter(void 0, void 0, void 0, fu
66
66
  export const deleteUserApi = (id) => __awaiter(void 0, void 0, void 0, function* () {
67
67
  const token = cookies.get("token");
68
68
  try {
69
- const response = yield axios.delete(`${apiUrl}/login/delete`, {
69
+ const response = yield axios.request({
70
+ method: "DELETE",
71
+ url: `${apiUrl}/login/delete`,
70
72
  headers: {
71
73
  Authorization: `Bearer ${token}`,
72
74
  "Content-Type": "application/json",
73
75
  },
74
- // data: {
75
- // id,
76
- // },
77
- params: {
76
+ data: {
78
77
  id,
79
78
  },
80
79
  });
81
80
  return response.data;
82
81
  }
83
82
  catch (error) {
84
- console.error("Error deleting lang:", error);
83
+ console.error("Error deleting user:", error);
85
84
  throw error;
86
85
  }
87
86
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eleven-solutions-common-website-unique-web",
3
- "version": "3.0.16",
3
+ "version": "3.0.18",
4
4
  "main": "./dist/index.js",
5
5
  "scripts": {
6
6
  "build": "tsc",
@@ -159,7 +159,8 @@ const TaxonomyForm = () => {
159
159
  };
160
160
 
161
161
  fetchIsMultiple();
162
- }, [type]);
162
+ // }, [type]);
163
+ }, []);
163
164
 
164
165
  const handleCancelClick = () => {
165
166
  setType("");
@@ -74,21 +74,20 @@ export const deleteUserApi = async (id: string) => {
74
74
  const token = cookies.get("token");
75
75
 
76
76
  try {
77
- const response = await axios.delete(`${apiUrl}/login/delete`, {
77
+ const response = await axios.request({
78
+ method: "DELETE",
79
+ url: `${apiUrl}/login/delete`,
78
80
  headers: {
79
81
  Authorization: `Bearer ${token}`,
80
82
  "Content-Type": "application/json",
81
83
  },
82
- // data: {
83
- // id,
84
- // },
85
- params: {
84
+ data: {
86
85
  id,
87
86
  },
88
87
  });
89
88
  return response.data;
90
89
  } catch (error) {
91
- console.error("Error deleting lang:", error);
90
+ console.error("Error deleting user:", error);
92
91
  throw error;
93
92
  }
94
93
  };