Rename selected voice model in get config API response for consistency

- Update references in new and old web client settings
- Arrange new client settings props and add header comments similar to
- config response for code readability
This commit is contained in:
Debanjum Singh Solanky
2024-07-17 17:12:26 +05:30
parent b3253562a5
commit ade2f6f5d1
3 changed files with 18 additions and 13 deletions

View File

@@ -34,30 +34,34 @@ export interface SyncedContent {
notion: boolean;
}
export interface UserConfig {
// user info
username: string | null;
user_photo: string | null;
is_active: boolean;
has_documents: boolean;
khoj_version: string;
enabled_content_source: SyncedContent;
anonymous_mode: boolean;
given_name: string;
phone_number: string;
is_phone_number_verified: boolean;
// user content, model settings
enabled_content_source: SyncedContent;
has_documents: boolean;
search_model_options: ModelOptions[];
selected_search_model_config: number;
chat_model_options: ModelOptions[];
selected_chat_model_config: number;
paint_model_options: ModelOptions[];
selected_paint_model_config: number;
billing_enabled: boolean;
voice_model_options: ModelOptions[];
selected_voice_model_config: number;
// user billing info
subscription_state: string;
subscription_renewal_date: string;
// server settings
khoj_cloud_subscription_url: string | undefined;
is_twilio_enabled: boolean;
billing_enabled: boolean;
is_eleven_labs_enabled: boolean;
voice_model_options: ModelOptions[];
selected_voice_config: number;
phone_number: string;
is_phone_number_verified: boolean;
is_twilio_enabled: boolean;
khoj_version: string;
anonymous_mode: boolean;
notion_oauth_url: string;
detail: string;
}
@@ -68,6 +72,7 @@ export function useUserConfig(detailed: boolean = false) {
const { data, error } = useSWR<UserConfig>(url, fetcher, { revalidateOnFocus: false });
if (error || !data || data.detail === 'Forbidden') return null;
console.log(data);
return data;
}