From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,URIBL_BLOCKED, URIBL_DBL_BLOCKED_OPENDNS autolearn=ham autolearn_force=no version=3.4.6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1696301554; bh=sH8+FTPjp4GptRHrWXjblD/SybJjf46G3aqQ5LAoAWo=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=sz+7JtrPewsBYwQSLkEDdJmupE9ERFydii74NAZvmTjwzXdpRur5uleIUW/ESE+yK TZCetQgA8Fz/k6D1IDbTeP4g/gIKBNUcL+uHL32JN4JcjT2nF5KCK3ppBy1+wC9kfi XN+MtHoSgPZz+wi/3MIs8N/RtaSod7kJGWhzV6niGu2Rk6fNSdbsvxRzHSSIRnXCV9 2jxdWmX+Zsx295miC0/cZ8/bGEwATI2u/G93VOSvU+VZdgWfOtgi1DCiJgzEwU1ZKa jn+QETOSnzhTMPegEhphPfvvdm2/+M+LS9PBoYdZ0dhfduKczOJ4XxxROTaeyXfyG4 0J+OcTgccQJZg== Received: from localhost.localdomain (unknown [175.158.50.50]) by gnuweeb.org (Postfix) with ESMTPSA id 5C6FB24B8D2; Tue, 3 Oct 2023 09:52:33 +0700 (WIB) From: Muhammad Rizki To: Ammar Faizi Cc: Muhammad Rizki , Alviro Iskandar Setiawan , Irvan Malik Azantha , Memet Zx , GNU/Weeb Mailing List Subject: [PATCH v1 10/13] feat(routes): add +page.server.ts Date: Tue, 3 Oct 2023 09:51:43 +0700 Message-Id: <20231003025146.1557-11-kiizuha@gnuweeb.org> X-Mailer: git-send-email 2.34.1.windows.1 In-Reply-To: <20231003025146.1557-1-kiizuha@gnuweeb.org> References: <20231003025146.1557-1-kiizuha@gnuweeb.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: This commit adds +page.server.ts, which is responsible for data fetching from the API on the server-side. It will be loaded with `export let data;` in +page.svelte. Signed-off-by: Muhammad Rizki --- src/routes/+page.server.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/routes/+page.server.ts diff --git a/src/routes/+page.server.ts b/src/routes/+page.server.ts new file mode 100644 index 0000000..d845c51 --- /dev/null +++ b/src/routes/+page.server.ts @@ -0,0 +1,13 @@ +import { getOrgMembers, getRecentMessages } from "$lib"; +import type { PageServerLoad } from "./$types"; + + +export const load = (async () => { + const memberListData = await getOrgMembers(); + const recentMsgData = await getRecentMessages(); + + return { + memberListData, + recentMsgData + } +}) satisfies PageServerLoad; -- Muhammad Rizki