mirror of
https://github.com/ershisan99/flashcards-api.git
synced 2025-12-16 12:33:17 +00:00
10 lines
483 B
TypeScript
10 lines
483 B
TypeScript
export class Pagination {
|
|
static getPaginationData(query) {
|
|
const page = typeof query.PageNumber === 'string' ? +query.PageNumber : 1
|
|
const pageSize = typeof query.PageSize === 'string' ? +query.PageSize : 10
|
|
const searchNameTerm = typeof query.SearchNameTerm === 'string' ? query.SearchNameTerm : ''
|
|
const searchEmailTerm = typeof query.SearchEmailTerm === 'string' ? query.SearchEmailTerm : ''
|
|
return { page, pageSize, searchNameTerm, searchEmailTerm }
|
|
}
|
|
}
|