Skip to content

Commit 4b52148

Browse files
committed
fix(dashboard-api): fix projectId extraction in checkCollectionLimit to allow bulk creation
1 parent c4ba2d7 commit 4b52148

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎apps/dashboard-api/src/middlewares/planEnforcement.js‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ exports.checkCollectionLimit = async function(req, res, next) {
103103
if (isAdminRequest(req)) return next();
104104
if (!req.developer?.isVerified) return next();
105105

106-
const cleanProjectId = sanitizeObjectId(req.body.projectId);
106+
const rawProjectId = req.params.projectId || req.body.projectId || req.query.projectId;
107+
const cleanProjectId = sanitizeObjectId(rawProjectId);
107108
if (!cleanProjectId) return next(new AppError(400, 'Invalid or missing projectId'));
108109

109110
const project = await Project.findOne({

0 commit comments

Comments
 (0)