Skip to content

Commit ac91a47

Browse files
author
devgioele
committed
rm usePagination from zod routers
1 parent 7ae917f commit ac91a47

6 files changed

Lines changed: 6 additions & 33 deletions

File tree

src/routers/__test__/inMemory.test.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
import { act, renderHook } from '@testing-library/react'
22
import { z } from 'zod'
33
import { NonNullableRecord } from '../../utils'
4-
import {
5-
useQuery,
6-
usePagination,
7-
useQueryAndPagination,
8-
} from '../../zod/routers/inMemory'
4+
import { useQuery, useQueryAndPagination } from '../../zod/routers/inMemory'
5+
import { usePagination } from '../inMemory'
96

107
describe('InMemory', () => {
118
const searchSchema = z.object({

src/routers/__test__/nextRouter.test.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,8 @@ import router from 'next/router'
33
import { z } from 'zod'
44
import { vi } from 'vitest'
55
import { NonNullableRecord } from '../../utils'
6-
import {
7-
useQuery,
8-
usePagination,
9-
useQueryAndPagination,
10-
} from '../../zod/routers/nextRouter'
6+
import { useQuery, useQueryAndPagination } from '../../zod/routers/nextRouter'
7+
import { usePagination } from '../nextRouter'
118

129
vi.mock('next/router', () => require('next-router-mock'))
1310

src/routers/__test__/reactRouter.test.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,8 @@ import { act, renderHook } from '@testing-library/react'
22
import { z } from 'zod'
33
import { BrowserRouter } from 'react-router-dom'
44
import { NonNullableRecord } from '../../utils'
5-
import {
6-
useQuery,
7-
usePagination,
8-
useQueryAndPagination,
9-
} from '../../zod/routers/reactRouter'
5+
import { useQuery, useQueryAndPagination } from '../../zod/routers/reactRouter'
6+
import { usePagination } from '../reactRouter'
107

118
const renderHookWithContext = <Result, Props>(
129
render: (initialProps: Props) => Result

src/zod/routers/inMemory.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import {
66
} from '../../engine'
77
import {
88
useQuery as useQueryVanilla,
9-
usePagination as usePaginationVanilla,
109
useQueryAndPagination as useQueryAndPaginationVanilla,
1110
} from '../../routers/inMemory'
1211
import { zodParser } from '../util'
@@ -40,8 +39,3 @@ export const useQueryAndPagination = <
4039
defaultPagination,
4140
options
4241
)
43-
44-
export const usePagination = (
45-
defaultPagination?: PaginationQuery,
46-
options?: Partial<AbstractQueryOptions>
47-
) => usePaginationVanilla(defaultPagination, options)

src/zod/routers/nextRouter.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import {
66
} from '../../engine'
77
import {
88
useQuery as useQueryVanilla,
9-
usePagination as usePaginationVanilla,
109
useQueryAndPagination as useQueryAndPaginationVanilla,
1110
} from '../../routers/nextRouter'
1211
import { zodParser } from '../util'
@@ -41,8 +40,3 @@ export const useQueryAndPagination = <
4140
defaultPagination,
4241
options
4342
)
44-
45-
export const usePagination = (
46-
defaultPagination?: PaginationQuery,
47-
options?: Partial<AbstractQueryOptions & RouterWithHistoryOptions>
48-
) => usePaginationVanilla(defaultPagination, options)

src/zod/routers/reactRouter.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import {
66
} from '../../engine'
77
import {
88
useQuery as useQueryVanilla,
9-
usePagination as usePaginationVanilla,
109
useQueryAndPagination as useQueryAndPaginationVanilla,
1110
} from '../../routers/reactRouter'
1211
import { zodParser } from '../util'
@@ -41,8 +40,3 @@ export const useQueryAndPagination = <
4140
defaultPagination,
4241
options
4342
)
44-
45-
export const usePagination = (
46-
defaultPagination?: PaginationQuery,
47-
options?: Partial<AbstractQueryOptions & RouterWithHistoryOptions>
48-
) => usePaginationVanilla(defaultPagination, options)

0 commit comments

Comments
 (0)