Skip to content

Commit 5f6e411

Browse files
committed
fix(dashboard-api): fix collection creation bug caused by premature onboarding early return
1 parent fb05b64 commit 5f6e411

1 file changed

Lines changed: 0 additions & 16 deletions

File tree

apps/dashboard-api/src/controllers/project.controller.js

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -861,22 +861,6 @@ module.exports.createCollection = async (req, res) => {
861861
return { project, connection, compiledCollectionName, collectionExistedBefore, projectId, collectionName };
862862
};
863863

864-
if (!req.user.onboarding?.completed) {
865-
const projectId = sanitizeObjectId(req.body.projectId);
866-
const project = await Project.findOne({ _id: projectId, owner: req.user._id });
867-
if (project) {
868-
const customCol = project.collections.find(c => c.name !== 'users');
869-
if (customCol) {
870-
await markDeveloperOnboardingStep(req.user._id, 'collectionCreated', { collectionId: customCol._id });
871-
const projectObj = project.toObject();
872-
delete projectObj.publishableKey;
873-
delete projectObj.secretKey;
874-
delete projectObj.jwtSecret;
875-
return res.status(201).json(projectObj);
876-
}
877-
}
878-
}
879-
880864
let session = null;
881865
try {
882866
session = await mongoose.startSession();

0 commit comments

Comments
 (0)