Fix calendar plan merge typing so production build can compile.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
4Ventures
2026-10-06 15:25:24 +02:00
parent 965a58540e
commit fac9867202
2 changed files with 7 additions and 11 deletions

View File

@@ -119,11 +119,8 @@ export default async function CalendarioPage({
.limit(2000);
pipe = (data as PipelineCalendarRow[]) || [];
}
const merged = mergePipelineIntoPlans(
plans as unknown as Parameters<typeof mergePipelineIntoPlans>[0],
pipe
);
plans.splice(0, plans.length, ...(merged as unknown as RrssMonthPlan[]));
const merged = mergePipelineIntoPlans(plans, pipe);
plans.splice(0, plans.length, ...(merged as RrssMonthPlan[]));
}
const monthParam = sp.month || plans[0]?.month;

View File

@@ -99,7 +99,6 @@ export type CalendarPlanLike = {
chips?: string[];
};
pieces: CalendarPieceLike[];
[key: string]: unknown;
};
function monthLabel(ym: string) {
@@ -109,11 +108,11 @@ function monthLabel(ym: string) {
}
/** Overlay published pipeline creatives onto RRSS month plans. */
export function mergePipelineIntoPlans<T extends CalendarPlanLike>(
plans: T[],
export function mergePipelineIntoPlans(
plans: CalendarPlanLike[],
items: PipelineCalendarRow[]
): T[] {
const out = plans.map((p) => ({
): CalendarPlanLike[] {
const out: CalendarPlanLike[] = plans.map((p) => ({
...p,
pieces: [...(p.pieces || [])],
}));
@@ -137,7 +136,7 @@ export function mergePipelineIntoPlans<T extends CalendarPlanLike>(
chips: ['Pipeline', 'Instagram'],
},
pieces: [],
} as T;
};
out.push(plan);
byMonth.set(ym, plan);
}