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.
@@ -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<
|
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.
|
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
|
-
|
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
|
83
|
+
console.error("Error deleting user:", error);
|
85
84
|
throw error;
|
86
85
|
}
|
87
86
|
});
|
package/package.json
CHANGED
@@ -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.
|
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
|
-
|
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
|
90
|
+
console.error("Error deleting user:", error);
|
92
91
|
throw error;
|
93
92
|
}
|
94
93
|
};
|