blob: 8c250026ff2345b1709ff367e0bf9eb4b6f52924 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
|
import { auth, get } from "$lib/utils";
import { redirect } from "@sveltejs/kit";
export async function load({ cookies, parent }) {
const { user } = await parent();
if (!user) redirect(307, "/login");
const users = (await get("/users", auth(cookies))).sort(
(a, b) => b.balance - a.balance,
);
return { users };
}
|