refactor(api): simplify app type parameter handling to single required parameter
Replace the previous dual-parameter approach (app_type/app/appType) with a single required `app: String` parameter across all Tauri commands. This change: - Introduces unified `parse_app()` helper replacing complex `resolve_app_type()` logic - Updates all backend commands in config, mcp, and provider modules - Aligns frontend API calls to use consistent `app` parameter naming - Simplifies MSW test handlers by removing optional parameter handling This improves API clarity and reduces parameter ambiguity while maintaining backward compatibility through error handling.
This commit is contained in:
@@ -31,11 +31,11 @@ export const settingsApi = {
|
||||
},
|
||||
|
||||
async getConfigDir(appType: AppType): Promise<string> {
|
||||
return await invoke("get_config_dir", { app_type: appType });
|
||||
return await invoke("get_config_dir", { app: appType });
|
||||
},
|
||||
|
||||
async openConfigFolder(appType: AppType): Promise<void> {
|
||||
await invoke("open_config_folder", { app_type: appType });
|
||||
await invoke("open_config_folder", { app: appType });
|
||||
},
|
||||
|
||||
async selectConfigDirectory(defaultPath?: string): Promise<string | null> {
|
||||
|
||||
Reference in New Issue
Block a user