Add Project Files section and show company name for external users on project detail

This commit is contained in:
Krao Hasanee
2026-05-14 15:01:32 -04:00
parent eee0885811
commit c32f9d1366
24 changed files with 1729 additions and 771 deletions
+19
View File
@@ -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;