fix(mindspace): repair OA drive JSON body parsing and trash paths

Express already parses JSON request bodies, so drive handlers must read req.body directly. Also fix nested trash item original-path parsing to match file-drop-sync behavior.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
john
2026-09-10 19:04:27 +08:00
parent 6d5eb15b1b
commit 97a3e89ff7
4 changed files with 166 additions and 3 deletions
+5 -2
View File
@@ -35,10 +35,13 @@ export async function listTrash(ctx) {
for (const entry of entries) {
const full = path.join(trashRoot(ctx), entry.name);
const stat = await fsp.stat(full);
const match = entry.name.match(/^(.+)__(.+)$/);
const separator = entry.name.indexOf('__');
const original = separator >= 0
? entry.name.slice(separator + 2).replace(/__/g, '/')
: entry.name;
items.push({
id: entry.name,
original: match ? match[2].replace(/__/g, '/') : entry.name,
original,
trashedAt: stat.mtimeMs,
isDirectory: stat.isDirectory(),
size: stat.isDirectory() ? null : stat.size,