feat: add version check app
CI / build-and-test (push) Canceled after 0s

This commit is contained in:
2026-10-27 00:05:00 +01:00
parent bdb465782d
commit 97572fe459
11 changed files with 140 additions and 4 deletions
+6 -1
View File
@@ -54,7 +54,12 @@ async function api<T = any>(endpoint: string, options: RequestInit = {}): Promis
const { headers: customHeaders, ...rest } = options;
const res = await fetch(`${API_URL}${endpoint}`, {
...rest,
headers: { 'Content-Type': 'application/json', ...(customHeaders as Record<string, string>) },
headers: {
'Content-Type': 'application/json',
// Plays an up-to-date terminal app, so the minimum app version never refuses it
'X-App-Version': process.env.APP_VERSION || '999.0.0',
...(customHeaders as Record<string, string>),
},
});
if (!res.ok) {
const body = await res.json().catch(() => null);