Fix calendar plan merge typing so production build can compile.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user