mirror of
https://github.com/runkids/skillshare.git
synced 2026-11-19 02:17:09 +00:00
feat(ui): add batchUninstall API client method and types
Add BatchUninstallRequest, BatchUninstallItemResult, and BatchUninstallResult interfaces plus the batchUninstall() method on the api object to call POST /uninstall/batch.
This commit is contained in:
@@ -127,6 +127,11 @@ export const api = {
|
||||
apiFetch<{ skill: Skill; skillMdContent: string; files: string[] }>(`/skills/${encodeURIComponent(name)}`),
|
||||
deleteSkill: (name: string) =>
|
||||
apiFetch<{ success: boolean }>(`/skills/${encodeURIComponent(name)}`, { method: 'DELETE' }),
|
||||
batchUninstall: (opts: BatchUninstallRequest) =>
|
||||
apiFetch<BatchUninstallResult>('/uninstall/batch', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify(opts),
|
||||
}),
|
||||
getTemplates: async () => {
|
||||
const res = await apiFetch<TemplatesResponse>('/skills/templates');
|
||||
// Normalize: Go omits nil slices, so scaffoldDirs may be undefined
|
||||
@@ -634,6 +639,23 @@ export interface BatchInstallResult {
|
||||
summary: string;
|
||||
}
|
||||
|
||||
export interface BatchUninstallRequest {
|
||||
names: string[];
|
||||
force?: boolean;
|
||||
}
|
||||
|
||||
export interface BatchUninstallItemResult {
|
||||
name: string;
|
||||
success: boolean;
|
||||
movedToTrash?: boolean;
|
||||
error?: string;
|
||||
}
|
||||
|
||||
export interface BatchUninstallResult {
|
||||
results: BatchUninstallItemResult[];
|
||||
summary: { succeeded: number; failed: number };
|
||||
}
|
||||
|
||||
export interface LocalSkillInfo {
|
||||
name: string;
|
||||
path: string;
|
||||
|
||||
Reference in New Issue
Block a user