Initial commit - WhyRating Engine (Google Reviews Scraper)

This commit is contained in:
Alejandro Gutiérrez
2026-02-02 18:19:00 +00:00
parent 0543a08242
commit 2206ddeff2
136 changed files with 51138 additions and 855 deletions

View File

@@ -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 }
);
}