refactor(api): merge review-queue into /api/activities, rename resolve to assign
Removes the unused GET /api/activities list/detail endpoints, moves the review-queue list and resolve/unlock/unassign actions under /api/activities, renames resolve to assign end-to-end, and drops the now-unused store.ReviewQueue helper. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -76,31 +76,6 @@ func (db *DB) CurrentAssignment(ctx context.Context, userID, activityID int64) (
|
||||
return a, true, nil
|
||||
}
|
||||
|
||||
// ReviewQueue returns userID's activities whose current assignment status
|
||||
// is needs_review, newest first.
|
||||
func (db *DB) ReviewQueue(ctx context.Context, userID int64) ([]KindAssignment, error) {
|
||||
rows, err := db.QueryContext(ctx, `
|
||||
SELECT `+kindAssignmentColumns+`
|
||||
FROM current_kind_assignment a
|
||||
JOIN activities ON activities.id = a.activity_id
|
||||
WHERE activities.user_id = ? AND a.status = ?
|
||||
ORDER BY a.created_at DESC`, userID, AssignmentStatusNeedsReview)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("review queue for user %d: %w", userID, err)
|
||||
}
|
||||
defer rows.Close()
|
||||
|
||||
assignments := []KindAssignment{}
|
||||
for rows.Next() {
|
||||
a, err := scanKindAssignment(rows)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("scan kind assignment row: %w", err)
|
||||
}
|
||||
assignments = append(assignments, a)
|
||||
}
|
||||
return assignments, rows.Err()
|
||||
}
|
||||
|
||||
// AllCurrentAssignments returns the latest assignment for every one of
|
||||
// userID's activities that has one, regardless of status or source -- the
|
||||
// basis for deciding which activities a global reclassify pass may touch.
|
||||
|
||||
Reference in New Issue
Block a user