Browse Source
- Added pagination functionality to the users and posts management pages, allowing for better navigation through large datasets. - Updated API endpoints to support pagination parameters and return total counts for users and posts. - Introduced a reusable pagination component to enhance user experience and streamline page transitions. These changes improve the overall usability of the admin interface by enabling efficient data handling and display.main
5 changed files with 176 additions and 32 deletions
@ -1,7 +1,8 @@ |
|||||
import { listPostsForUser } from "#server/service/posts"; |
import { listPostsPageForUser } from "#server/service/posts"; |
||||
|
|
||||
export default defineWrappedResponseHandler(async (event) => { |
export default defineWrappedResponseHandler(async (event) => { |
||||
const user = await event.context.auth.requireUser(); |
const user = await event.context.auth.requireUser(); |
||||
const rows = await listPostsForUser(user.id); |
const q = getQuery(event); |
||||
return R.success({ posts: rows }); |
const payload = await listPostsPageForUser(user.id, q.page); |
||||
|
return R.success(payload); |
||||
}); |
}); |
||||
|
|||||
Loading…
Reference in new issue