Skip to content

Conversation

@guanbinrui
Copy link
Member

Summary

This PR cleans up API routes and removes debug code to improve code quality and ensure proper API functionality.

Changes

  • Removed debug code: Removed debug echo statement from status API route handler
  • Fixed route pattern: Corrected the route pattern for /api/i/user/@user_id by removing the trailing optional slash (/?) to ensure proper route matching
  • Code formatting: Improved code readability by consolidating condition checks onto a single line
  • Added validation: Added username parameter validation condition using allCharsInSet to ensure proper input validation

Files Changed

  • src/jsons/status.nim
  • src/jsons/timeline.nim

Testing

  • Verified API routes work correctly
  • Tested user ID lookup endpoint
  • Verified username validation works as expected

- Remove debug echo statement from status API route
- Fix route pattern for /api/i/user/@user_id by removing trailing optional slash
- Improve code formatting by consolidating condition checks
- Add validation condition for username parameter in timeline API route

These changes improve code quality and ensure API routes work correctly.
@guanbinrui guanbinrui merged commit 7ca4f79 into master Dec 10, 2025
0 of 3 checks passed
@guanbinrui guanbinrui deleted the fix/api-routes-cleanup branch December 10, 2025 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants