Dough Git

clove/allInOne

web/src/routes/+page.ts

back to web/src/routes

/* src/routes/+page.ts
 * Copyright (c) 2026 Clove Nytrix Doughmination Twilight
 * Licensed under the DASL-1.0 Licence.
 * See LICENCE.md in the project root for full licence information.
 */

import type { PageLoad } from "./$types";
import { publicClient } from "#lib/api.ts";

export const load: PageLoad = async ({ fetch, depends, url }) => {
  depends("api:public");
  const api = publicClient(fetch, url.origin);

  const [members, fronters, system] = await Promise.all([
    api.getMembers().catch(() => []),
    api.getFronters().catch(() => null),
    api.getSystem().catch(() => null),
  ]);

  return {
    members,
    fronters,
    system,
  };
};