Skip to content

fix: sort schedules by name in list query#4125

Merged
Siumauricio merged 2 commits intoDokploy:canaryfrom
dpulpeiro:fix/sort-schedules-by-name
Apr 3, 2026
Merged

fix: sort schedules by name in list query#4125
Siumauricio merged 2 commits intoDokploy:canaryfrom
dpulpeiro:fix/sort-schedules-by-name

Conversation

@dpulpeiro
Copy link
Copy Markdown
Contributor

@dpulpeiro dpulpeiro commented Apr 2, 2026

Summary

  • Schedules in the web UI were displayed in arbitrary (database insertion) order
  • Added orderBy: [asc(schedules.name)] to the schedule.list query so they are returned sorted alphabetically by name

Greptile Summary

This PR fixes the arbitrary ordering of scheduled tasks in the UI by adding orderBy: [asc(schedules.name)] to the schedule.list query, ensuring results are returned sorted alphabetically by name.

  • The change is minimal and correct: asc is properly imported from drizzle-orm and applied to the schedules.name column, which is already in use throughout the router.
  • The orderBy array syntax is the right approach for Drizzle ORM's findMany.
  • No other queries or endpoints are affected by this change.

Confidence Score: 5/5

  • This PR is safe to merge — it is a single-line, non-breaking addition of deterministic sort ordering to a read query.
  • The change is isolated to one query, uses a well-established Drizzle ORM API, touches no mutation logic, and has no impact on data integrity or security.
  • No files require special attention.

Reviews (1): Last reviewed commit: "fix: sort schedules by name in list quer..." | Re-trigger Greptile

(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!

Schedules were returned in arbitrary order from the database.
Add orderBy clause to sort them alphabetically by name.
@dpulpeiro dpulpeiro requested a review from Siumauricio as a code owner April 2, 2026 09:49
@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Apr 2, 2026
Updated the orderBy clause in the schedules query to sort by the createdAt field instead of the name, ensuring schedules are returned in the order they were created.
@Siumauricio Siumauricio merged commit e5aae15 into Dokploy:canary Apr 3, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants