mirror of
https://github.com/QuantumNous/new-api.git
synced 2026-03-30 08:56:02 +00:00
🐛 fix(models): export setActivePage to prevent tab-change TypeError
Context: Clicking a vendor tab triggered “setActivePage is not a function” from ModelsTabs.jsx:43. Root cause: ModelsTabs expects `setActivePage` via props (spread from `useModelsData`), but the hook did not expose it in its return object, so the prop resolved to `undefined`. Fix: Export `setActivePage` from `useModelsData`’s return object so `ModelsTabs` receives a valid function. Result: Tab switching now correctly resets pagination to page 1 and reloads models without runtime errors. Files: - web/src/hooks/models/useModelsData.jsx Test plan: - Open the Models page - Click different vendor tabs - Verify no crash occurs and the list reloads with page reset to 1 Refs: web/src/components/table/models/ModelsTabs.jsx:43
This commit is contained in:
@@ -462,6 +462,7 @@ export const useModelsData = () => {
|
||||
copyText,
|
||||
|
||||
// Pagination
|
||||
setActivePage,
|
||||
handlePageChange,
|
||||
handlePageSizeChange,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user