ReviewOS

also looking at this

stacks/wildloop

Migrate :text/x-text bindings to {⁠{ }} interpolation (stx 0.2.72)

#990
Merged glennmichael123 wants to merge chore/migrate-text-to-mustache into main
50 files +611 -371
app/Actions/Activity/ActivityIndexAction.tsmodified+4-3
Changes to app/Actions/Activity/ActivityIndexAction.ts
@@ -30,13 +30,13 @@ export default new Action({
3030
3131 async handle(request) {
3232 const userId = request.get<number>('user_id')
33 const limit = Math.min(Math.max(request.get<number>('limit') || 100, 1), 500)
33 const page = readPageParams(request, { defaultLimit: 100, maxLimit: 500 })
3434
3535 try {
3636 const query = userId
3737 ? Activity.where('user_id', '=', userId)
3838 : Activity.query()
39 const rows = (await query.orderBy('completed_at', 'desc').limit(limit).get()) ?? []
39 const rows = (await query.orderBy('completed_at', 'desc').get()) ?? []
4040
4141 // Batch-load owners + trails so the feed gets names without N+1 lookups.
4242 const userIds = [...new Set(rows.map((a: any) => a.user_id).filter(Boolean))]
@@ -71,7 +71,8 @@ export default new Action({
7171 }
7272 })
7373
74 return response.json({ activities, meta: { total: activities.length } })
74 const { items, meta } = paginate(activities, page)
75 return response.json({ activities: items, meta })
7576 }
7677 catch (error) {
7778 console.error('[activities] index failed:', error)