Se agrega paginacion a historial

This commit is contained in:
2026-02-12 10:55:19 -06:00
parent e788eb788f
commit 9102e756cb
4 changed files with 74 additions and 17 deletions

View File

@@ -80,11 +80,17 @@ export function usePlanAsignaturas(planId: UUID | null | undefined) {
})
}
export function usePlanHistorial(planId: UUID | null | undefined) {
export function usePlanHistorial(
planId: UUID | null | undefined,
page: number,
) {
return useQuery({
queryKey: planId ? qk.planHistorial(planId) : ['planes', 'historial', null],
queryFn: () => plans_history(planId as UUID),
queryKey: planId
? [...qk.planHistorial(planId), page]
: ['planes', 'historial', null, page],
queryFn: () => plans_history(planId as UUID, page),
enabled: Boolean(planId),
placeholderData: (previousData) => previousData,
})
}