19242b4152
- EventToastBridge checks notification_toast_level and notification_mute_categories - toast-rules.ts: event-to-category/severity mapping functions - Settings page: notification preferences section (toast level dropdown, mute checkboxes) - Settings API types extended with notification preference fields - 17 frontend tests (toast-rules + bridge) - Preference hierarchy: mute categories → toast level → show/hide Quality gates: vitest 17 passed, tsc clean, eslint clean
34 lines
965 B
TypeScript
34 lines
965 B
TypeScript
import { apiClient } from "./client";
|
|
|
|
export interface UserConfig {
|
|
default_editor: string | null;
|
|
theme: string;
|
|
git_user_name: string | null;
|
|
git_user_email: string | null;
|
|
last_session_id: string | null;
|
|
notification_toast_level?: "all" | "errors" | "none";
|
|
notification_mute_categories?: string[];
|
|
}
|
|
|
|
export interface UserConfigUpdate {
|
|
default_editor?: string | null;
|
|
theme?: string | null;
|
|
git_user_name?: string | null;
|
|
git_user_email?: string | null;
|
|
last_session_id?: string | null;
|
|
notification_toast_level?: "all" | "errors" | "none";
|
|
notification_mute_categories?: string[];
|
|
}
|
|
|
|
export const getUserConfig = async (): Promise<UserConfig> => {
|
|
const response = await apiClient.get<UserConfig>("/users/me/config");
|
|
return response.data;
|
|
};
|
|
|
|
export const updateUserConfig = async (
|
|
data: UserConfigUpdate,
|
|
): Promise<UserConfig> => {
|
|
const response = await apiClient.patch<UserConfig>("/users/me/config", data);
|
|
return response.data;
|
|
};
|