Skip to content

Commit

Permalink
fix(overdue-task): take more than 5 records per page (#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
hudy9x authored Apr 15, 2024
1 parent 97935d0 commit fe8d1f4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/be-gateway/src/routes/task/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ router.get('/project/task/query', async (req: AuthRequest, res) => {
})
}
}
console.log('1')
console.log('2')

const tasks = await mdTaskGetAll(rest)
if (counter) {
Expand Down
2 changes: 2 additions & 0 deletions packages/shared-models/src/lib/task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,8 @@ export const mdTaskGetAll = (query: ITaskQuery) => {
return taskModel.count({ where })
}

console.log('task get all:', take, skip)

return taskModel.findMany({
skip,
take,
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-app/app/_features/MyWorks/MyworkCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default function MyworkCard({ title, query }: IMyworkCardProps) {
const take = limit * page
const skip = page === 1 ? 0 : take - limit

return { take, skip }
return { take: limit, skip }
}, [page])
const maxPage = Math.ceil(total / limit)

Expand Down

0 comments on commit fe8d1f4

Please sign in to comment.