fix: previews Meta vía proxy y creatividades Google PMax/RSA

Las imágenes Meta dejan de romperse en el navegador; Google trae assets en vivo.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
4Ventures
2026-09-23 18:25:48 +02:00
parent 86225a701e
commit d05df8c371
5 changed files with 697 additions and 57 deletions

View File

@@ -5,9 +5,9 @@ import { isAgencyRole, userRole } from '@/lib/agency';
import { AdDailyRow } from '@/lib/metrics';
import {
AdCreativeCard,
buildGoogleCardsFromDaily,
fetchMetaCreativeCards,
} from '@/lib/ad-creatives-meta';
import { fetchGoogleCreativeCards } from '@/lib/ad-creatives-google';
export const dynamic = 'force-dynamic';
@@ -73,14 +73,22 @@ export async function GET(req: NextRequest) {
dailyRows: daily,
since,
until,
limit: 40,
limit: 16,
});
metaAds = meta.ads;
if (meta.warning) warnings.push(meta.warning);
}
if (platform === 'google' || platform === 'all') {
googleAds = buildGoogleCardsFromDaily(daily, since, until, 40);
const google = await fetchGoogleCreativeCards({
tenantId: ctx.tenantId,
dailyRows: daily,
since,
until,
limit: 24,
});
googleAds = google.ads;
if (google.warning) warnings.push(google.warning);
}
return NextResponse.json({