Untitled
unknown
typescript
a year ago
541 B
7
Indexable
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;
};Editor is loading...
Leave a Comment