feat(panel-cliente): soporte de filtrado mensual, histórico instagram ene-sep 2026 y enlaces a publicaciones

This commit is contained in:
Marcos Fargas
2026-10-04 19:31:11 +02:00
parent a3a2e4b62b
commit 2f6e50d5a7
4 changed files with 799 additions and 36 deletions

View File

@@ -65,7 +65,7 @@ export async function GET(req: NextRequest) {
let q = `${supabaseUrl()}/rest/v1/creative_pipeline?tenant_id=eq.${encodeURIComponent(
ctx.tenantId
)}&select=${SELECT}&order=month.asc,created_at.asc`;
)}&select=${SELECT}&order=month.asc,created_at.asc&limit=1000`;
if (month) q += `&month=eq.${encodeURIComponent(month)}`;
if (ctx.viaView) {
@@ -87,7 +87,8 @@ export async function GET(req: NextRequest) {
.from('creative_pipeline')
.select(SELECT)
.order('month', { ascending: true })
.order('created_at', { ascending: true });
.order('created_at', { ascending: true })
.limit(1000);
if (month) query = query.eq('month', month);
const { data, error } = await query;