Files UI complete with search, sharing via symlink.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { Handlers } from 'fresh/server.ts';
|
||||
|
||||
import { Directory, FreshContextState } from '/lib/types.ts';
|
||||
import { getDirectories, getDirectoryAccess, renameDirectoryOrFile } from '/lib/data/files.ts';
|
||||
import { getDirectories, renameDirectoryOrFile } from '/lib/data/files.ts';
|
||||
|
||||
interface Data {}
|
||||
|
||||
@@ -32,20 +32,10 @@ export const handler: Handlers<Data, FreshContextState> = {
|
||||
return new Response('Bad Request', { status: 400 });
|
||||
}
|
||||
|
||||
const { hasWriteAccess, ownerUserId, ownerParentPath } = await getDirectoryAccess(
|
||||
const movedDirectory = await renameDirectoryOrFile(
|
||||
context.state.user.id,
|
||||
requestBody.parentPath,
|
||||
requestBody.oldName.trim(),
|
||||
);
|
||||
|
||||
if (!hasWriteAccess) {
|
||||
return new Response('Forbidden', { status: 403 });
|
||||
}
|
||||
|
||||
const movedDirectory = await renameDirectoryOrFile(
|
||||
ownerUserId,
|
||||
ownerParentPath,
|
||||
ownerParentPath,
|
||||
requestBody.parentPath,
|
||||
requestBody.oldName.trim(),
|
||||
requestBody.newName.trim(),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user