Add Project Files section and show company name for external users on project detail
This commit is contained in:
@@ -428,6 +428,25 @@ export default async function handler(req, res) {
|
||||
});
|
||||
}
|
||||
|
||||
if (req.method === 'POST' && action === 'rename') {
|
||||
const newName = safeName(req.body?.name, '');
|
||||
if (!newName) return json(res, 400, { error: 'New name is required.' });
|
||||
|
||||
const type = req.body?.type || 'file';
|
||||
const endpoint = type === 'dir'
|
||||
? `/api2/repos/${encodeURIComponent(config.repoId)}/dir/?p=${encodeURIComponent(resolved.seafilePath)}`
|
||||
: `/api2/repos/${encodeURIComponent(config.repoId)}/file/?p=${encodeURIComponent(resolved.seafilePath)}`;
|
||||
|
||||
const body = new URLSearchParams({ operation: 'rename', newname: newName });
|
||||
await seafileRequest(config, endpoint, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
||||
body,
|
||||
});
|
||||
|
||||
return json(res, 200, { success: true });
|
||||
}
|
||||
|
||||
if (req.method === 'POST' && action === 'move') {
|
||||
const srcPath = req.body?.srcPath;
|
||||
const dstDir = req.body?.dstDir;
|
||||
|
||||
Reference in New Issue
Block a user