mirror of
https://github.com/spacedriveapp/spacedrive
synced 2024-07-08 07:12:49 +00:00
use files.cutFiles
route within TS
This commit is contained in:
parent
6196df4e48
commit
efc7843c24
|
@ -83,6 +83,7 @@ export type Procedures = {
|
|||
| { key: 'volumes.list'; input: never; result: Array<Volume> };
|
||||
mutations:
|
||||
| { key: 'files.copyFiles'; input: LibraryArgs<FileCopierJobInit>; result: null }
|
||||
| { key: 'files.cutFiles'; input: LibraryArgs<FileCutterJobInit>; result: null }
|
||||
| { key: 'files.decryptFiles'; input: LibraryArgs<FileDecryptorJobInit>; result: null }
|
||||
| { key: 'files.delete'; input: LibraryArgs<number>; result: null }
|
||||
| { key: 'files.deleteFiles'; input: LibraryArgs<FileDeleterJobInit>; result: null }
|
||||
|
@ -189,6 +190,13 @@ export interface FileCopierJobInit {
|
|||
target_path: string;
|
||||
}
|
||||
|
||||
export interface FileCutterJobInit {
|
||||
source_location_id: number;
|
||||
source_path_id: number;
|
||||
target_location_id: number;
|
||||
target_path: string;
|
||||
}
|
||||
|
||||
export interface FileDecryptorJobInit {
|
||||
location_id: number;
|
||||
path_id: number;
|
||||
|
|
|
@ -106,6 +106,7 @@ export function ExplorerContextMenu(props: PropsWithChildren) {
|
|||
const objectValidator = useLibraryMutation('jobs.objectValidator');
|
||||
const rescanLocation = useLibraryMutation('locations.fullRescan');
|
||||
const copyFiles = useLibraryMutation('files.copyFiles');
|
||||
const cutFiles = useLibraryMutation('files.cutFiles');
|
||||
|
||||
return (
|
||||
<div className="relative">
|
||||
|
@ -150,7 +151,13 @@ export function ExplorerContextMenu(props: PropsWithChildren) {
|
|||
target_path: params.path
|
||||
});
|
||||
} else {
|
||||
// cut here
|
||||
store.locationId &&
|
||||
cutFiles.mutate({
|
||||
source_location_id: store.cutCopyState.sourceLocationId,
|
||||
source_path_id: store.cutCopyState.sourcePathId,
|
||||
target_location_id: store.locationId,
|
||||
target_path: params.path
|
||||
});
|
||||
}
|
||||
}}
|
||||
icon={Clipboard}
|
||||
|
|
Loading…
Reference in a new issue