feat: restructure into XFlow monorepo with Nuxt 4, Modular Onion Monolith, Android client, and Desktop CLI
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import { requireAuth } from '~/server/utils/auth'
|
||||
import { getUserAchievements, achievements } from '~/server/utils/db'
|
||||
|
||||
export default defineEventHandler(async (event) => {
|
||||
const user = requireAuth(event)
|
||||
|
||||
// Calculate stats
|
||||
const userAchievements = getUserAchievements(user.id)
|
||||
const totalCompleted = userAchievements.filter((a: any) => a.id?.startsWith('completed-')).length
|
||||
|
||||
return {
|
||||
achievements: userAchievements,
|
||||
stats: {
|
||||
total: userAchievements.length,
|
||||
completedTasks: totalCompleted
|
||||
}
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user