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);
|
.limit(2000);
|
||||||
pipe = (data as PipelineCalendarRow[]) || [];
|
pipe = (data as PipelineCalendarRow[]) || [];
|
||||||
}
|
}
|
||||||
const merged = mergePipelineIntoPlans(
|
const merged = mergePipelineIntoPlans(plans, pipe);
|
||||||
plans as unknown as Parameters<typeof mergePipelineIntoPlans>[0],
|
plans.splice(0, plans.length, ...(merged as RrssMonthPlan[]));
|
||||||
pipe
|
|
||||||
);
|
|
||||||
plans.splice(0, plans.length, ...(merged as unknown as RrssMonthPlan[]));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const monthParam = sp.month || plans[0]?.month;
|
const monthParam = sp.month || plans[0]?.month;
|
||||||
|
|||||||
@@ -99,7 +99,6 @@ export type CalendarPlanLike = {
|
|||||||
chips?: string[];
|
chips?: string[];
|
||||||
};
|
};
|
||||||
pieces: CalendarPieceLike[];
|
pieces: CalendarPieceLike[];
|
||||||
[key: string]: unknown;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
function monthLabel(ym: string) {
|
function monthLabel(ym: string) {
|
||||||
@@ -109,11 +108,11 @@ function monthLabel(ym: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Overlay published pipeline creatives onto RRSS month plans. */
|
/** Overlay published pipeline creatives onto RRSS month plans. */
|
||||||
export function mergePipelineIntoPlans<T extends CalendarPlanLike>(
|
export function mergePipelineIntoPlans(
|
||||||
plans: T[],
|
plans: CalendarPlanLike[],
|
||||||
items: PipelineCalendarRow[]
|
items: PipelineCalendarRow[]
|
||||||
): T[] {
|
): CalendarPlanLike[] {
|
||||||
const out = plans.map((p) => ({
|
const out: CalendarPlanLike[] = plans.map((p) => ({
|
||||||
...p,
|
...p,
|
||||||
pieces: [...(p.pieces || [])],
|
pieces: [...(p.pieces || [])],
|
||||||
}));
|
}));
|
||||||
@@ -137,7 +136,7 @@ export function mergePipelineIntoPlans<T extends CalendarPlanLike>(
|
|||||||
chips: ['Pipeline', 'Instagram'],
|
chips: ['Pipeline', 'Instagram'],
|
||||||
},
|
},
|
||||||
pieces: [],
|
pieces: [],
|
||||||
} as T;
|
};
|
||||||
out.push(plan);
|
out.push(plan);
|
||||||
byMonth.set(ym, plan);
|
byMonth.set(ym, plan);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user