import { get, post } from '../utils/http.js'

// 获取我的代理
export const getMyAgency = async () => {
  try {
    const response = await get(`/team/team-own/profile`)
    return response
  } catch (error) {
    console.error('Failed to fetch get my agency:', error)
    console.error('error:' + error.response.errorMsg)
    throw error
  }
}

// 退出团队
export const leaveAgency = async (data) => {
  try {
    const response = await post(`/team/user/apply`, data)
    return response
  } catch (error) {
    console.error('Failed to fetch leave agency:', error)
    console.error('error:' + error.response.errorMsg)
    throw error
  }
}
