chore: update
ci-api / test (push) Successful in 22m17s
ci-web / test (push) Successful in 13m44s

This commit is contained in:
Xor290
2026-08-02 18:34:59 +02:00
parent 6992e505ae
commit c5ee5636ef
34 changed files with 2660 additions and 498 deletions
+11 -1
View File
@@ -133,13 +133,20 @@ export interface TelegramInfo {
telegram: string
}
export interface AlertSettings {
discord_webhook_url: string
telegram_bot_token: string
telegram_chat_id: string
}
// --- Endpoints ---
export const api = {
login: (username: string, password: string) =>
login: (username: string, password: string, role: Role) =>
request<{ token: string; token_type: string; role: Role }>('POST', '/auth/login', {
username,
password,
role,
}),
register: (username: string, password: string) =>
request<{ token: string; token_type: string; role: Role }>('POST', '/auth/register', {
@@ -197,4 +204,7 @@ export const api = {
getTelegram: () => request<TelegramInfo>('GET', '/profile/telegram'),
setTelegram: (telegram: string) =>
request<TelegramInfo>('POST', '/profile/telegram', { telegram }),
getAlertSettings: () => request<AlertSettings>('GET', '/profile/alerts'),
setAlertSettings: (settings: AlertSettings) =>
request<AlertSettings>('POST', '/profile/alerts', settings),
}