Add pagination to QSO Log and back buttons to pages

- Add backend pagination support for /api/qsos endpoint (page, limit params)
- Return paginated results with metadata (totalCount, totalPages, hasNext, hasPrev)
- Add pagination UI to QSOs page with prev/next buttons and page numbers
- Add back button to QSO Log and Settings pages linking to main menu
- Reset to page 1 when applying filters

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-15 22:10:23 +01:00
parent dde0c18f51
commit 40a3e3642e
4 changed files with 215 additions and 20 deletions

View File

@@ -391,6 +391,7 @@ const app = new Elysia()
/**
* GET /api/qsos
* Get user's QSOs (requires authentication)
* Supports pagination: ?page=1&limit=100
*/
.get('/api/qsos', async ({ user, query, set }) => {
if (!user) {
@@ -404,12 +405,17 @@ const app = new Elysia()
if (query.mode) filters.mode = query.mode;
if (query.confirmed) filters.confirmed = query.confirmed === 'true';
const qsos = await getUserQSOs(user.id, filters);
// Pagination options
const options = {
page: query.page ? parseInt(query.page) : 1,
limit: query.limit ? parseInt(query.limit) : 100,
};
const result = await getUserQSOs(user.id, filters, options);
return {
success: true,
qsos,
count: qsos.length,
...result,
};
} catch (error) {
set.status = 500;