Untitled
export const getLocations = async ( type: string, authToken?: string, filters?: string[] ) => { const queryParams: Record<string, string> = { type }; if (filters) { queryParams.filters = JSON.stringify(filters); } const queryString = new URLSearchParams(queryParams).toString(); const endpoint = `${api.locations}?${queryString}`; const response = await apiClient.get(endpoint, { headers: { "Content-Type": "application/json", Authorization: `${authToken}`, }, }); return response.data; };
Leave a Comment