Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/routes/(console)/organization-[organization]/+page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export const load: PageLoad = async ({ params, url, route, depends, parent }) =>
...projectScopeQueries,
Query.offset(offset),
Query.limit(limit),
Query.orderDesc(''),
Query.orderDesc('accessedAt'),
Query.equal('teamId', params.organization)
]
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const load: PageLoad = async ({ url, route, params, depends }) => {
search,
page,
users: await sdk.forProject(params.region, params.project).users.list({
queries: [Query.limit(limit), Query.offset(offset), Query.orderDesc('')],
queries: [Query.limit(limit), Query.offset(offset), Query.orderDesc('accessedAt')],
search
})
Comment on lines 25 to 28

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Search + accessedAt ordering may conflict

The search string is passed as a separate top-level parameter alongside Query.orderDesc('accessedAt') in queries. Users who have never logged in will have a null accessedAt, so they'll always sort to the bottom regardless of search relevance — this is probably fine. The harder edge is whether the backend allows ordering by accessedAt when search is also provided: no other page in the codebase pairs a non-empty orderDesc field with the search param, so this is an untested combination. If the dependent backend PR (appwrite#12645) doesn't explicitly support ordering-with-search, this will break search on the Users page with a query error.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

};
Expand Down