Download src/api/scrapeApi.ts from Jessedbrown/daisy-client: direct link, hf CLI and curl.
- Browser
- Download file 862 Bytes
-
https://huggingface.co/Jessedbrown/daisy-client/resolve/main/src/api/scrapeApi.ts
- Command line
-
hf download hf://Jessedbrown/daisy-client/src/api/scrapeApi.ts
-
curl -L -o scrapeApi.ts https://huggingface.co/Jessedbrown/daisy-client/resolve/main/src/api/scrapeApi.ts
862 Bytes
| import { BackendApiResponse } from '@/types'; | |
| import { apiClient } from './client'; | |
| export const scrapeApi = { | |
| // Get available brands for scraping | |
| getAvailableBrands: async (): Promise<string[]> => { | |
| const response = | |
| await apiClient.get<BackendApiResponse<string[]>>('/scrape/brands'); | |
| return response.data.data; | |
| }, | |
| // Start scraping for specific brand | |
| scrapeBrand: async (brand: string): Promise<{ message: string }> => { | |
| const response = await apiClient.post< | |
| BackendApiResponse<{ message: string }> | |
| >(`/scrape/brand/${brand}`); | |
| return response.data.data; | |
| }, | |
| // Start scraping for all brands | |
| scrapeAll: async (): Promise<{ message: string }> => { | |
| const response = | |
| await apiClient.post<BackendApiResponse<{ message: string }>>( | |
| '/scrape/all' | |
| ); | |
| return response.data.data; | |
| }, | |
| }; | |