feat: Add scraper version selector to frontend
- Add version selector dropdown in scrape confirmation modal - Default to v1.1.0 (Multi-Sort) which bypasses ~1000 review limit - Pass scraper_version through API proxy to backend - Update /new page fallback to show v1.1.0 as available - Show version description explaining multi-sort benefits Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -5,23 +5,25 @@ const API_BASE_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:8000';
|
||||
export async function POST(request: NextRequest) {
|
||||
try {
|
||||
const body = await request.json();
|
||||
const { url, business_name, business_address, rating_snapshot, total_reviews_snapshot } = body;
|
||||
const { url, business_name, business_address, rating_snapshot, total_reviews_snapshot, scraper_version } = body;
|
||||
|
||||
if (!url) {
|
||||
return NextResponse.json({ error: 'URL is required' }, { status: 400 });
|
||||
}
|
||||
|
||||
// Call the containerized scraper API with business metadata
|
||||
// Call the containerized scraper API with business metadata and version
|
||||
const response = await fetch(`${API_BASE_URL}/scrape`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
url,
|
||||
scraper_version, // Pass version to backend for routing
|
||||
metadata: {
|
||||
business_name,
|
||||
business_address,
|
||||
rating_snapshot,
|
||||
total_reviews_snapshot,
|
||||
scraper_version, // Also store in metadata for job tracking
|
||||
},
|
||||
}),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user