Revert unsolicited creative pipeline review-only changes.
Restore CreativesPipeline on /creatives and the previous board/API behavior (published pieces visible again; no forced reject note). Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -189,7 +189,7 @@ export async function PATCH(req: NextRequest) {
|
||||
const curRes = await fetch(
|
||||
`${supabaseUrl()}/rest/v1/creative_pipeline?id=eq.${encodeURIComponent(
|
||||
id
|
||||
)}&tenant_id=eq.${encodeURIComponent(ctx.tenantId)}&select=status,notes`,
|
||||
)}&tenant_id=eq.${encodeURIComponent(ctx.tenantId)}&select=status`,
|
||||
{ headers: headers || undefined, cache: 'no-store' }
|
||||
);
|
||||
const curRows = curRes.ok ? await curRes.json() : [];
|
||||
@@ -215,20 +215,6 @@ export async function PATCH(req: NextRequest) {
|
||||
);
|
||||
}
|
||||
clean.status = next;
|
||||
if (next === 'rechazado') {
|
||||
const note = str(body.notes, 2000);
|
||||
if (!note) {
|
||||
return NextResponse.json(
|
||||
{ error: 'Añade una nota explicando qué hay que cambiar.' },
|
||||
{ status: 400 }
|
||||
);
|
||||
}
|
||||
const prev = str(curRows?.[0]?.notes, 2000) || '';
|
||||
const line = `CLIENT_NOTE: ${note}`;
|
||||
clean.notes = prev.includes(line)
|
||||
? prev
|
||||
: [line, prev].filter(Boolean).join('\n');
|
||||
}
|
||||
}
|
||||
if (next === 'aprobado') {
|
||||
clean.approved_by = user.id;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
/**
|
||||
* Pipeline de creatividades — cola de revisión (no archivo publicado).
|
||||
* Lo publicado se abre en el calendario, día a día.
|
||||
* Pipeline de creatividades — cola de aprobación con preview de placement
|
||||
* (Meta/Google Ads + RRSS), estilo Ad Tracker.
|
||||
*/
|
||||
'use client';
|
||||
|
||||
import CreativePipelineBoard from '@/components/CreativePipelineBoard';
|
||||
import CreativesPipeline from '@/components/CreativesPipeline';
|
||||
|
||||
export default function CreativesPage() {
|
||||
return <CreativePipelineBoard />;
|
||||
return <CreativesPipeline />;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user