mirror of
https://github.com/get-drexa/drive.git
synced 2025-11-30 21:41:39 +00:00
feat: add trash page
This commit is contained in:
@@ -1,16 +1,19 @@
|
||||
import { v } from "convex/values"
|
||||
import { authenticatedMutation } from "./functions"
|
||||
import { authenticatedMutation, authenticatedQuery } from "./functions"
|
||||
import * as Directories from "./model/directories"
|
||||
import * as Err from "./model/error"
|
||||
import * as Files from "./model/files"
|
||||
import type { DirectoryHandle, FileHandle } from "./model/filesystem"
|
||||
import type {
|
||||
DirectoryHandle,
|
||||
FileHandle,
|
||||
FileSystemItem,
|
||||
} from "./model/filesystem"
|
||||
import {
|
||||
type FileSystemHandle,
|
||||
FileType,
|
||||
VDirectoryHandle,
|
||||
VFileSystemHandle,
|
||||
} from "./model/filesystem"
|
||||
|
||||
export const moveItems = authenticatedMutation({
|
||||
args: {
|
||||
targetDirectory: VDirectoryHandle,
|
||||
@@ -100,3 +103,16 @@ export const moveToTrash = authenticatedMutation({
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
export const fetchDirectoryContent = authenticatedQuery({
|
||||
args: {
|
||||
directoryId: v.optional(v.id("directories")),
|
||||
trashed: v.boolean(),
|
||||
},
|
||||
handler: async (
|
||||
ctx,
|
||||
{ directoryId, trashed },
|
||||
): Promise<FileSystemItem[]> => {
|
||||
return await Directories.fetchContent(ctx, { directoryId, trashed })
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user