From 7362b23d0d3f42873c581e986301ec6abd0fadf1 Mon Sep 17 00:00:00 2001 From: million1156 Date: Wed, 27 Mar 2024 08:49:16 -0500 Subject: [PATCH] Add back the amount of stars the repository has --- src/routes/+page.server.ts | 13 ++++--------- src/routes/+page.svelte | 2 +- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/routes/+page.server.ts b/src/routes/+page.server.ts index 2ce74a2..ab4f281 100644 --- a/src/routes/+page.server.ts +++ b/src/routes/+page.server.ts @@ -19,21 +19,16 @@ async function fetchServerSideData() { }, }) : Promise.resolve({ json: () => roleMembers }), - GITLAB_API_TOKEN - ? fetch("https://gitlab.com/api/v4/projects/suyu-emu%2Fsuyu/", { - headers: { - Authorization: `Bearer ${GITLAB_API_TOKEN}`, - }, - }) - : Promise.resolve({ json: () => ({ star_count: 0 }) }), // Default to 0 if no token is provided + fetch("https://git.suyu.dev/api/v1/repos/suyu/suyu"), + ]; const [res, roles, gitlabRes] = await Promise.all(promises); const jsonPromises = [res.json(), roles.json(), gitlabRes.json()]; - const [resJson, rolesJson, gitlabResJson] = await Promise.all(jsonPromises); + const [resJson, rolesJson, gitResJson] = await Promise.all(jsonPromises); memberCount = resJson.approximate_member_count; - starCount = gitlabResJson.star_count; + starCount = gitResJson.stars_count; if (DISCORD_USER_TOKEN) roleMembers = rolesJson; console.log("Member count:", memberCount); diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 7447cf2..bc8c970 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -116,7 +116,7 @@ >

By the numbers

- +