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;
    }
};
