feat(frontend): grab limits from API, add created time + member count to settings

This commit is contained in:
sam 2024-09-30 22:05:14 +02:00
parent 4002893323
commit 562ecc46bd
Signed by: sam
GPG key ID: B4EF20DDE721CAA1
7 changed files with 174 additions and 114 deletions

View file

@ -1,5 +1,11 @@
import "dotenv/config";
import { env } from "node:process";
import { Limits } from "~/lib/api/meta";
export const API_BASE = env.API_BASE || "https://pronouns.localhost/api";
export const LANGUAGE = env.LANGUAGE || "en";
const apiLimits: Limits = await fetch(`${API_BASE}/v2/meta`)
.then((resp) => resp.json())
.then((m) => m.limits);
export const limits: Limits = Object.freeze(apiLimits);