Initial commit: SIBU 2.0 MISSION
This commit is contained in:
27
frontend/src/services/usersService.ts
Normal file
27
frontend/src/services/usersService.ts
Normal file
@ -0,0 +1,27 @@
|
||||
import { apiClient } from './apiClient';
|
||||
|
||||
export const usersService = {
|
||||
async searchUsers(email: string) {
|
||||
const response = await apiClient.get('/api/users/search', {
|
||||
params: { email }
|
||||
});
|
||||
return response.data;
|
||||
},
|
||||
|
||||
async getUserDetails(userId: string) {
|
||||
const response = await apiClient.get(`/api/users/${userId}`);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
async getPendingDrivers() {
|
||||
const response = await apiClient.get('/api/users/pending-drivers');
|
||||
return response.data;
|
||||
},
|
||||
|
||||
async verifyUser(userId: string, isVerified: boolean) {
|
||||
const response = await apiClient.post(`/api/users/${userId}/verify`, null, {
|
||||
params: { is_verified: isVerified }
|
||||
});
|
||||
return response.data;
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user