diff --git a/backend/src/services/solution_access_service.cc b/backend/src/services/solution_access_service.cc index 85643a8..0405deb 100644 --- a/backend/src/services/solution_access_service.cc +++ b/backend/src/services/solution_access_service.cc @@ -247,13 +247,13 @@ SolutionAccessService::ListRatingHistory(int64_t user_id, int limit) { "' || problem_id) as note " "FROM problem_solution_view_logs WHERE user_id=? AND cost > 0 " "UNION ALL " - "SELECT 'daily_task' as type, created_at, reward as change, title as " + "SELECT 'daily_task' as type, created_at, reward as change, task_code as " "note " "FROM daily_task_logs WHERE user_id=? " "UNION ALL " "SELECT 'redeem' as type, created_at, -total_cost as change, item_name " "as note " - "FROM redeem_logs WHERE user_id=? " + "FROM redeem_records WHERE user_id=? " "ORDER BY created_at DESC LIMIT ?"; CheckSqlite(sqlite3_prepare_v2(db, sql, -1, &stmt, nullptr), db, diff --git a/frontend/src/app/me/page.tsx b/frontend/src/app/me/page.tsx index 95eb5f3..4c19772 100644 --- a/frontend/src/app/me/page.tsx +++ b/frontend/src/app/me/page.tsx @@ -149,7 +149,7 @@ export default function MePage() { apiFetch("/api/v1/me/redeem/items", {}, tk), apiFetch("/api/v1/me/redeem/records?limit=200", {}, tk), apiFetch("/api/v1/me/daily-tasks", {}, tk), - listRatingHistory(50), + listRatingHistory(50, tk), ]); setProfile(me); setItems(redeemItems ?? []); diff --git a/frontend/src/lib/api.ts b/frontend/src/lib/api.ts index be5db67..53f800f 100644 --- a/frontend/src/lib/api.ts +++ b/frontend/src/lib/api.ts @@ -98,6 +98,6 @@ export interface RatingHistoryItem { note: string; } -export async function listRatingHistory(limit: number = 100): Promise { - return apiFetch(`/api/v1/me/rating-history?limit=${limit}`); +export async function listRatingHistory(limit: number = 100, token?: string): Promise { + return apiFetch(`/api/v1/me/rating-history?limit=${limit}`, {}, token); }