Add password auth, business browsing, dev proxy, and production env.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import { api } from './client';
|
||||
import type { Business } from './types';
|
||||
|
||||
export function fetchBusinesses(params?: {
|
||||
categoryId?: string;
|
||||
isActive?: boolean;
|
||||
}) {
|
||||
const search = new URLSearchParams();
|
||||
if (params?.categoryId) {
|
||||
search.set('categoryId', params.categoryId);
|
||||
}
|
||||
if (params?.isActive !== undefined) {
|
||||
search.set('isActive', String(params.isActive));
|
||||
}
|
||||
const query = search.toString();
|
||||
return api<Business[]>(`/businesses${query ? `?${query}` : ''}`);
|
||||
}
|
||||
|
||||
export function fetchBusiness(id: string) {
|
||||
return api<Business>(`/businesses/${id}`);
|
||||
}
|
||||
Reference in New Issue
Block a user