Initial commit - WhyRating Engine (Google Reviews Scraper)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { NextRequest, NextResponse } from 'next/server';
|
||||
|
||||
const API_BASE_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:8000';
|
||||
const API_BASE_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:8001';
|
||||
|
||||
// GET /api/jobs/[jobId]/compare?previous=<previousJobId>
|
||||
// Returns reviews from current job with a flag indicating if they're new
|
||||
@@ -16,8 +16,10 @@ export async function GET(
|
||||
// Fetch current job reviews
|
||||
const currentResponse = await fetch(`${API_BASE_URL}/jobs/${jobId}/reviews?limit=10000`);
|
||||
if (!currentResponse.ok) {
|
||||
const errorText = await currentResponse.text().catch(() => '');
|
||||
console.error(`Failed to get current job reviews: ${currentResponse.status} - ${errorText}`);
|
||||
return NextResponse.json(
|
||||
{ error: 'Failed to get current job reviews' },
|
||||
{ error: `Failed to get reviews for job ${jobId} (${currentResponse.status})` },
|
||||
{ status: currentResponse.status }
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user