import { Company, Office } from "@/data"; import { axios } from "@/api/index"; import { prepare, query } from "@/routing"; export const COMPANY_SEARCH_ENDPOINT = '/companies'; export const COMPANY_OFFICES_ENDPOINT = '/companies/:id' export async function search(name: string): Promise { const companies = await axios.get(query(COMPANY_SEARCH_ENDPOINT, { Name: name })); return companies.data; } export async function offices(id: string): Promise { const response = await axios.get(prepare(COMPANY_OFFICES_ENDPOINT, { id })); return response.data; }