MCPcopy Create free account
hub / github.com/MCSManager/MCSManager / useDeleteFileApi

Function useDeleteFileApi

frontend/src/hooks/useFileManager.ts:433–453  ·  view source on GitHub ↗
(files: string[])

Source from the content-addressed store, hash-verified

431 const deleteFile = async (file?: string) => {
432 const { execute } = deleteFileApi();
433 const useDeleteFileApi = async (files: string[]) => {
434 try {
435 await execute({
436 params: {
437 uuid: instanceId || "",
438 daemonId: daemonId || ""
439 },
440 data: {
441 targets: files
442 }
443 });
444 await getFileList();
445 message.success(t("TXT_CODE_cae10a08"));
446 if (dataSource?.value?.length === 0 && operationForm.value.current > 1) {
447 operationForm.value.current -= 1;
448 await getFileList();
449 }
450 } catch (error: any) {
451 reportErrorMsg(error.message);
452 }
453 };
454
455 Modal.confirm({
456 title: t("TXT_CODE_71155575"),

Callers 1

onOkFunction · 0.85

Calls 3

reportErrorMsgFunction · 0.90
executeFunction · 0.85
getFileListFunction · 0.85

Tested by

no test coverage detected