mirror of
https://github.com/get-drexa/drive.git
synced 2025-12-01 05:51:39 +00:00
impl: permanent file deletion
implement trash page and permanent file deletion logic Co-authored-by: Ona <no-reply@ona.com>
This commit is contained in:
@@ -8,12 +8,14 @@ import type {
|
||||
FileHandle,
|
||||
FileSystemItem,
|
||||
} from "./model/filesystem"
|
||||
import * as FileSystem from "./model/filesystem"
|
||||
import {
|
||||
type FileSystemHandle,
|
||||
FileType,
|
||||
VDirectoryHandle,
|
||||
VFileSystemHandle,
|
||||
} from "./model/filesystem"
|
||||
|
||||
export const moveItems = authenticatedMutation({
|
||||
args: {
|
||||
targetDirectory: VDirectoryHandle,
|
||||
@@ -116,3 +118,12 @@ export const fetchDirectoryContent = authenticatedQuery({
|
||||
return await Directories.fetchContent(ctx, { directoryId, trashed })
|
||||
},
|
||||
})
|
||||
|
||||
export const permanentlyDeleteItems = authenticatedMutation({
|
||||
args: {
|
||||
handles: v.array(VFileSystemHandle),
|
||||
},
|
||||
handler: async (ctx, { handles }) => {
|
||||
return await FileSystem.deleteItemsPermanently(ctx, { handles })
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user