fix(documents): port-scope folder test cleanup + tighten parent-validation message
Code-review followups on 4b31f01:
- beforeEach now scopes the documentFolders cleanup to the test port
via .where(eq(documentFolders.portId, portId)) so parallel suites
don't wipe each other's fixtures.
- Cross-port parent guard message changed from "Parent folder not
found in this port" (read like a 404) to "Invalid parent folder"
to match the ValidationError type that already maps to 400.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -88,7 +88,7 @@ export async function createFolder(
|
||||
const parent = await db.query.documentFolders.findFirst({
|
||||
where: and(eq(documentFolders.id, data.parentId), eq(documentFolders.portId, portId)),
|
||||
});
|
||||
if (!parent) throw new ValidationError('Parent folder not found in this port');
|
||||
if (!parent) throw new ValidationError('Invalid parent folder');
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user