chore: update
This commit is contained in:
+11
-1
@@ -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),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user