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:
2025-10-05 00:41:59 +00:00
parent e806d442b7
commit 19e52feebb
7 changed files with 396 additions and 14 deletions

View File

@@ -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 })
},
})