Corregir mensajes de conversación fix #121

This commit is contained in:
2026-02-18 08:41:59 -06:00
parent cd16b3cb4f
commit 99ed75b2eb
2 changed files with 48 additions and 27 deletions

View File

@@ -168,10 +168,8 @@ export async function getConversationByPlan(planId: string) {
.from('conversaciones_plan')
.select('*')
.eq('plan_estudio_id', planId)
.eq('estado', 'ACTIVA')
.order('creado_en', { ascending: true }) // Añade un orden para que el último sea el más nuevo
.order('creado_en', { ascending: true })
if (error) throw error
return data ?? [] // Devuelve un array vacío en lugar de null para evitar el "undefined"
return data ?? []
}