refactor: directory path handling
intsead of storing path as field in directories table, it is derived on demand, because it makes moving directories a heck lot eaiser Co-authored-by: Ona <no-reply@ona.com>
This commit is contained in:
@@ -54,10 +54,9 @@ export const fetchDirectory = authenticatedQuery({
|
||||
export const fetchDirectoryContent = authenticatedQuery({
|
||||
args: {
|
||||
directoryId: v.optional(v.id("directories")),
|
||||
path: v.optional(v.string()),
|
||||
},
|
||||
handler: async (ctx, { directoryId, path }): Promise<DirectoryItem[]> => {
|
||||
return await Directories.fetchContent(ctx, { directoryId, path })
|
||||
handler: async (ctx, { directoryId }): Promise<DirectoryItem[]> => {
|
||||
return await Directories.fetchContent(ctx, { directoryId })
|
||||
},
|
||||
})
|
||||
|
||||
|
Reference in New Issue
Block a user