refactor: remove legacy evaluation route and update user management interfaces
- Deleted the obsolete evaluations route to streamline the API. - Added User and UserFormData interfaces to admin-client for better user management. - Updated useUsersManagement hook to utilize adminClient for fetching and creating users, improving data handling. - Cleaned up unused imports and code for better maintainability.
This commit is contained in:
@@ -25,6 +25,20 @@ export interface TeamMember {
|
||||
joinedAt: string;
|
||||
}
|
||||
|
||||
export interface UserFormData {
|
||||
firstName: string;
|
||||
lastName: string;
|
||||
teamId: string;
|
||||
}
|
||||
|
||||
export interface User {
|
||||
uuid: string;
|
||||
firstName: string;
|
||||
lastName: string;
|
||||
teamName?: string;
|
||||
hasEvaluations: boolean;
|
||||
}
|
||||
|
||||
export class AdminClient extends BaseHttpClient {
|
||||
// Skills Management
|
||||
async getSkills(): Promise<Skill[]> {
|
||||
@@ -80,6 +94,14 @@ export class AdminClient extends BaseHttpClient {
|
||||
}
|
||||
|
||||
// User Management
|
||||
async getUsers(): Promise<User[]> {
|
||||
return await this.get<User[]>(`/admin/users`);
|
||||
}
|
||||
|
||||
async createUser(userData: UserFormData): Promise<User> {
|
||||
return await this.post<User>(`/admin/users`, userData);
|
||||
}
|
||||
|
||||
async deleteUser(userId: string): Promise<void> {
|
||||
await this.delete(`/admin/users/${userId}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user