mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-06-16 13:34:04 +08:00
931ef7d3dd
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.
13 lines
351 B
TypeScript
13 lines
351 B
TypeScript
import { invoke } from "@tauri-apps/api/core";
|
|
import type { UsageResult } from "@/types";
|
|
import type { AppType } from "./types";
|
|
|
|
export const usageApi = {
|
|
async query(providerId: string, appType: AppType): Promise<UsageResult> {
|
|
return await invoke("query_provider_usage", {
|
|
provider_id: providerId,
|
|
app: appType,
|
|
});
|
|
},
|
|
};
|