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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user