mirror of
https://github.com/ershisan99/flashcards-api.git
synced 2025-12-17 12:33:22 +00:00
refactor imports/exports
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { isObject } from 'remeda'
|
||||
import { DEFAULT_PAGE_NUMBER, DEFAULT_PAGE_SIZE } from './pagination.constants'
|
||||
|
||||
export class Pagination {
|
||||
static getPaginationData<T>(query: T) {
|
||||
@@ -9,13 +10,13 @@ export class Pagination {
|
||||
typeof query.currentPage === 'string' &&
|
||||
!isNaN(Number(query.currentPage))
|
||||
? +query.currentPage
|
||||
: 1
|
||||
: DEFAULT_PAGE_NUMBER
|
||||
const itemsPerPage =
|
||||
'itemsPerPage' in query &&
|
||||
typeof query.itemsPerPage === 'string' &&
|
||||
!isNaN(Number(query.itemsPerPage))
|
||||
? +query.itemsPerPage
|
||||
: 10
|
||||
: DEFAULT_PAGE_SIZE
|
||||
return { currentPage, itemsPerPage, ...query }
|
||||
}
|
||||
|
||||
|
||||
3
src/infrastructure/decorators/index.ts
Normal file
3
src/infrastructure/decorators/index.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export * from './cookie.decorator'
|
||||
export * from './is-optional-or-empty-string.decorator'
|
||||
export * from './is-order-by-constraint.decorator'
|
||||
Reference in New Issue
Block a user