Merge branch 'main' into feat/add-runtime-env

This commit is contained in:
Lucas Smith
2024-02-08 22:06:59 +11:00
committed by GitHub
294 changed files with 15355 additions and 1451 deletions

View File

@@ -6,13 +6,18 @@ import { ZLimitsResponseSchema } from './schema';
export type GetLimitsOptions = {
headers?: Record<string, string>;
teamId?: number | null;
};
export const getLimits = async ({ headers }: GetLimitsOptions = {}) => {
export const getLimits = async ({ headers, teamId }: GetLimitsOptions = {}) => {
const requestHeaders = headers ?? {};
const url = new URL('/api/limits', APP_BASE_URL() ?? 'http://localhost:3000');
if (teamId) {
requestHeaders['team-id'] = teamId.toString();
}
return fetch(url, {
headers: {
...requestHeaders,