diff --git a/frontend/modules/commercial/composables/__tests__/useClientsRepository.spec.ts b/frontend/modules/commercial/composables/__tests__/useClientsRepository.spec.ts index 71e505e..0c3f194 100644 --- a/frontend/modules/commercial/composables/__tests__/useClientsRepository.spec.ts +++ b/frontend/modules/commercial/composables/__tests__/useClientsRepository.spec.ts @@ -25,8 +25,8 @@ function makeHydra(total: number): HydraCollection { describe('useClientsRepository', () => { beforeEach(() => { mockGet.mockReset() - // 25 items → 3 pages a 10/page : permet de tester la navigation page 2. - mockGet.mockResolvedValue(makeHydra(25)) + // 60 items → 3 pages a 25/page : permet de tester la navigation page 2. + mockGet.mockResolvedValue(makeHydra(60)) }) it('cible la ressource /clients en page 1 par defaut', async () => { @@ -35,7 +35,7 @@ describe('useClientsRepository', () => { expect(mockGet).toHaveBeenLastCalledWith( '/clients', - { page: 1, itemsPerPage: 10 }, + { page: 1, itemsPerPage: 25 }, expect.objectContaining({ toast: false }), ) }) @@ -65,7 +65,7 @@ describe('useClientsRepository', () => { 'siteId[]': ['1', '2'], archivedOnly: true, page: 1, - itemsPerPage: 10, + itemsPerPage: 25, }, expect.objectContaining({ toast: false }), ) @@ -78,7 +78,7 @@ describe('useClientsRepository', () => { expect(mockGet).toHaveBeenLastCalledWith( '/clients', - { page: 1, itemsPerPage: 10 }, + { page: 1, itemsPerPage: 25 }, expect.objectContaining({ toast: false }), ) }) diff --git a/frontend/modules/commercial/composables/__tests__/useSuppliersRepository.spec.ts b/frontend/modules/commercial/composables/__tests__/useSuppliersRepository.spec.ts index a7a6f42..0f7fb04 100644 --- a/frontend/modules/commercial/composables/__tests__/useSuppliersRepository.spec.ts +++ b/frontend/modules/commercial/composables/__tests__/useSuppliersRepository.spec.ts @@ -25,8 +25,8 @@ function makeHydra(total: number): HydraCollection { describe('useSuppliersRepository', () => { beforeEach(() => { mockGet.mockReset() - // 25 items → 3 pages a 10/page : permet de tester la navigation page 2. - mockGet.mockResolvedValue(makeHydra(25)) + // 60 items → 3 pages a 25/page : permet de tester la navigation page 2. + mockGet.mockResolvedValue(makeHydra(60)) }) it('cible la ressource /suppliers en page 1 par defaut', async () => { @@ -35,7 +35,7 @@ describe('useSuppliersRepository', () => { expect(mockGet).toHaveBeenLastCalledWith( '/suppliers', - { page: 1, itemsPerPage: 10 }, + { page: 1, itemsPerPage: 25 }, expect.objectContaining({ toast: false }), ) }) @@ -65,7 +65,7 @@ describe('useSuppliersRepository', () => { 'siteId[]': ['86', '17'], archivedOnly: true, page: 1, - itemsPerPage: 10, + itemsPerPage: 25, }, expect.objectContaining({ toast: false }), ) @@ -78,7 +78,7 @@ describe('useSuppliersRepository', () => { expect(mockGet).toHaveBeenLastCalledWith( '/suppliers', - { page: 1, itemsPerPage: 10 }, + { page: 1, itemsPerPage: 25 }, expect.objectContaining({ toast: false }), ) }) diff --git a/frontend/modules/commercial/composables/useClientsRepository.ts b/frontend/modules/commercial/composables/useClientsRepository.ts index d347435..95dbf7c 100644 --- a/frontend/modules/commercial/composables/useClientsRepository.ts +++ b/frontend/modules/commercial/composables/useClientsRepository.ts @@ -49,5 +49,6 @@ export interface Client { * gerer. */ export function useClientsRepository() { - return usePaginatedList({ url: '/clients' }) + // Pagination par defaut a 25 sur le repertoire (retour metier ERP-193). + return usePaginatedList({ url: '/clients', defaultItemsPerPage: 25 }) } diff --git a/frontend/modules/commercial/composables/useSuppliersRepository.ts b/frontend/modules/commercial/composables/useSuppliersRepository.ts index 37031ea..e8c4ff3 100644 --- a/frontend/modules/commercial/composables/useSuppliersRepository.ts +++ b/frontend/modules/commercial/composables/useSuppliersRepository.ts @@ -51,5 +51,6 @@ export interface Supplier { * `usePaginatedList`. Aucun reset au logout a gerer. */ export function useSuppliersRepository() { - return usePaginatedList({ url: '/suppliers' }) + // Pagination par defaut a 25 sur le repertoire (retour metier ERP-193). + return usePaginatedList({ url: '/suppliers', defaultItemsPerPage: 25 }) } diff --git a/frontend/modules/technique/composables/__tests__/useProvidersRepository.test.ts b/frontend/modules/technique/composables/__tests__/useProvidersRepository.test.ts index 3e0a201..336ff76 100644 --- a/frontend/modules/technique/composables/__tests__/useProvidersRepository.test.ts +++ b/frontend/modules/technique/composables/__tests__/useProvidersRepository.test.ts @@ -44,7 +44,7 @@ describe('useProvidersRepository', () => { expect(mockApiGet).toHaveBeenCalledTimes(1) const [url, query, opts] = mockApiGet.mock.calls[0] expect(url).toBe('/providers') - expect(query).toMatchObject({ page: 1, itemsPerPage: 10 }) + expect(query).toMatchObject({ page: 1, itemsPerPage: 25 }) expect(opts).toMatchObject({ toast: false, headers: { Accept: 'application/ld+json' }, diff --git a/frontend/modules/technique/composables/useProvidersRepository.ts b/frontend/modules/technique/composables/useProvidersRepository.ts index eadb9e3..610bd56 100644 --- a/frontend/modules/technique/composables/useProvidersRepository.ts +++ b/frontend/modules/technique/composables/useProvidersRepository.ts @@ -59,5 +59,6 @@ export interface Provider { * `usePaginatedList`. Aucun reset au logout a gerer. */ export function useProvidersRepository() { - return usePaginatedList({ url: '/providers' }) + // Pagination par defaut a 25 sur le repertoire (retour metier ERP-193). + return usePaginatedList({ url: '/providers', defaultItemsPerPage: 25 }) } diff --git a/frontend/modules/transport/composables/__tests__/useCarriersRepository.test.ts b/frontend/modules/transport/composables/__tests__/useCarriersRepository.test.ts index 3da48a3..5c92b97 100644 --- a/frontend/modules/transport/composables/__tests__/useCarriersRepository.test.ts +++ b/frontend/modules/transport/composables/__tests__/useCarriersRepository.test.ts @@ -50,7 +50,7 @@ describe('useCarriersRepository', () => { expect(mockApiGet).toHaveBeenCalledTimes(1) const [url, query, opts] = mockApiGet.mock.calls[0] expect(url).toBe('/carriers') - expect(query).toMatchObject({ page: 1, itemsPerPage: 10 }) + expect(query).toMatchObject({ page: 1, itemsPerPage: 25 }) expect(opts).toMatchObject({ toast: false, headers: { Accept: 'application/ld+json' }, diff --git a/frontend/modules/transport/composables/useCarriersRepository.ts b/frontend/modules/transport/composables/useCarriersRepository.ts index 941eee7..c4fa655 100644 --- a/frontend/modules/transport/composables/useCarriersRepository.ts +++ b/frontend/modules/transport/composables/useCarriersRepository.ts @@ -66,5 +66,6 @@ export interface CarrierFilters { * `usePaginatedList`. Aucun reset au logout a gerer. */ export function useCarriersRepository() { - return usePaginatedList({ url: '/carriers' }) + // Pagination par defaut a 25 sur le repertoire (retour metier ERP-193). + return usePaginatedList({ url: '/carriers', defaultItemsPerPage: 25 }) }