feat(reset-password): implement reset password functionality for admins and customers
- Added new ResetPasswordModalContent component for displaying generated passwords. - Integrated reset password functionality in the AdminsTable and CustomersTable components, allowing users to reset passwords for admins and customers. - Created useResetPasswordModalPresenter hook to manage password visibility and clipboard copying. - Updated API services and hooks to support reset password requests for both admins and customers. - Enhanced tooltip functionality for reset password actions in the tables.
This commit is contained in:
@@ -10,6 +10,7 @@ import {
|
||||
LoginResponseSchema,
|
||||
LogoutResponseSchema,
|
||||
TChangeAdminStatusCredentials,
|
||||
TResetPasswordResponse,
|
||||
} from "../types";
|
||||
|
||||
export const userService = {
|
||||
@@ -92,6 +93,16 @@ export const userService = {
|
||||
throw error;
|
||||
}
|
||||
},
|
||||
resetAdminPassword: async (
|
||||
id: string,
|
||||
): Promise<ApiResponse<TResetPasswordResponse>> => {
|
||||
try {
|
||||
return (await api.post(API_ENDPOINTS.USER.RESET_ADMIN_PASSWORD(id))).data;
|
||||
} catch (error) {
|
||||
console.error("ERROR caught in User Service Reset Admin Password", error);
|
||||
throw error;
|
||||
}
|
||||
},
|
||||
changeAdminStatus: async ({
|
||||
id,
|
||||
credentials,
|
||||
|
||||
Reference in New Issue
Block a user