mirror of
https://github.com/HeyPuter/puter.git
synced 2026-09-22 21:26:04 +00:00
fix: update path when renaming during save_account
We do update the path of all child directories by calling filesystem.update_child_paths(), but this was never done for the user's actual home directory itself (only everything under it). The most ideal solution would be to delegate this behavior to the move operation instead of updating the fsentries table directly, but making this change right now has a high risk of breaking changes since this the behavior in this file is very old.
This commit is contained in:
@@ -160,10 +160,11 @@ router.post('/save_account', auth, express.json(), async (req, res, next)=>{
|
||||
|
||||
// Update root directory name
|
||||
await db.write(
|
||||
`UPDATE fsentries SET name = ? WHERE user_id = ? and parent_uid IS NULL`,
|
||||
`UPDATE fsentries SET name = ?, path = ? WHERE user_id = ? and parent_uid IS NULL`,
|
||||
[
|
||||
// name
|
||||
req.body.username,
|
||||
'/' + req.body.username,
|
||||
// id
|
||||
req.user.id,
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user