fix(ports): list ports in creation order so the primary port leads
All checks were successful
Build & Push Docker Images / lint (push) Successful in 2m43s
Build & Push Docker Images / build-and-push (push) Successful in 7m31s

listPorts() ordered alphabetically, putting "Port Amador" ahead of
"Port Nimara" in the switcher and as the default a super-admin lands on.
Order by creation instead (oldest first) so the first-seeded port — the
primary tenant, Port Nimara — leads. Name is a tiebreaker.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-03 00:51:12 +02:00
parent c70eb1f945
commit 102ee493f8

View File

@@ -11,7 +11,11 @@ import type { CreatePortInput, UpdatePortInput } from '@/lib/validators/ports';
import { ensureSystemRoots } from '@/lib/services/document-folders.service';
export async function listPorts() {
return db.select().from(ports).orderBy(ports.name);
// Creation order (oldest first), not alphabetical: the first-seeded port
// is the primary one (Port Nimara), so it leads the switcher and is the
// default a super-admin lands on. Alphabetical put "Port Amador" ahead of
// "Port Nimara". Name is a stable tiebreaker for same-instant inserts.
return db.select().from(ports).orderBy(ports.createdAt, ports.name);
}
export async function getPort(id: string) {