import api from '$lib/utils/api';

export const teamService = {
  getTeamMembers: async (params = {}) => {
    try {
      const queryParams = new URLSearchParams();
      
      if (params.limit) queryParams.append('limit', params.limit);
      if (params.page) queryParams.append('page', params.page);
      
      const url = `/team?${queryParams.toString()}`;
      return await api.get(url);
    } catch (error) {
      console.error('Error fetching team:', error);
      return [];
    }
  },

  getTeamMember: async (id) => {
    try {
      return await api.get(`/team?id=${id}`);
    } catch (error) {
      console.error('Error fetching team member:', error);
      throw error;
    }
  }
};