Data/Users: Sort users by username

This commit is contained in:
2025-01-25 17:16:23 +01:00
parent 7659e03324
commit 7ec8411011

View File

@ -3,7 +3,9 @@ import type { LayoutServerLoad } from "./$types";
export const load: LayoutServerLoad = async ({ fetch, locals }) => {
const fetch_users = async (): Promise<User[]> => {
const users: User[] = await locals.pb.collection("users").getFullList({ fetch: fetch });
const users: User[] = await locals.pb
.collection("users")
.getFullList({ fetch: fetch, sort: "+username" });
users.map((user: User) => {
user.avatar_url = locals.pb.files.getURL(user, user.avatar);