fix(01): calendar slot merge in OutputReview for PN/Schwartz badges
GenerateResponse now includes calendar field from backend. OutputReview merges CalendarSlot into PostResult via slot_index, enabling BadgePN, BadgeSchwartz rendering and Retry button. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -25,10 +25,15 @@ export function OutputReview() {
|
||||
// Stato locale dei post — viene aggiornato da edit inline e rigenerazione
|
||||
const [localResults, setLocalResults] = useState<PostResult[]>([])
|
||||
|
||||
// Inizializza i risultati quando arrivano dal backend
|
||||
// Inizializza i risultati e merge con CalendarSlot dal calendario
|
||||
useEffect(() => {
|
||||
if (jobData?.results) {
|
||||
setLocalResults(jobData.results)
|
||||
const slots = jobData.calendar?.slots
|
||||
const merged = jobData.results.map((r) => ({
|
||||
...r,
|
||||
slot: slots?.find((s) => s.indice === r.slot_index) ?? r.slot,
|
||||
}))
|
||||
setLocalResults(merged)
|
||||
}
|
||||
}, [jobData])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user