fix: use qsoId for fetching QSO details in award page modal
The award page was filtering QSOs by callsign/date/band/mode, which could return the wrong QSO when multiple QSOs with the same callsign exist on the same band/mode combination. Changes: - Backend: Add qsoId field to award entity breakdown responses - Backend: Add GET /api/qsos/:id endpoint to fetch QSO by ID - Backend: Implement getQSOById() function in lotw.service.js - Frontend: Update openQSODetailModal() to fetch by qsoId instead of filtering - Frontend: Include qsoId in QSO entry objects for modal click handler Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -451,3 +451,18 @@ export async function deleteQSOs(userId) {
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a single QSO by ID for a specific user
|
||||
* @param {number} userId - User ID
|
||||
* @param {number} qsoId - QSO ID
|
||||
* @returns {Object|null} QSO object or null if not found
|
||||
*/
|
||||
export async function getQSOById(userId, qsoId) {
|
||||
const result = await db
|
||||
.select()
|
||||
.from(qsos)
|
||||
.where(and(eq(qsos.userId, userId), eq(qsos.id, qsoId)));
|
||||
|
||||
return result.length > 0 ? result[0] : null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user