Fix getUserAchievements to handle missing unlocked_at field

cgen-48f30678b39e43ec8a6fd8e605154254
This commit is contained in:
Builder.io 2025-08-16 04:11:50 +00:00
parent 9f23130777
commit 854ac3b37e

View file

@ -282,12 +282,11 @@ export const aethexAchievementService = {
.from("user_achievements")
.select(
`
unlocked_at,
achievement_id,
achievements (*)
`,
)
.eq("user_id", userId)
.order("unlocked_at", { ascending: false });
.eq("user_id", userId);
if (error) {
console.error("Error fetching user achievements:", error);