Browse Source

fix: if project not found throw error

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/5816/head
Pranav C 2 years ago
parent
commit
4e67941de0
  1. 1
      packages/nocodb/src/middlewares/extract-project-id/extract-project-id.middleware.ts

1
packages/nocodb/src/middlewares/extract-project-id/extract-project-id.middleware.ts

@ -37,6 +37,7 @@ export class ExtractProjectIdMiddleware implements NestMiddleware, CanActivate {
// extract project id based on request path params
if (params.projectName) {
const project = await Project.getByTitleOrId(params.projectName);
if (!project) NcError.notFound('Project not found');
req.ncProjectId = project.id;
res.locals.project = project;
}

Loading…
Cancel
Save