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:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user