Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
connorjclark committed Dec 14, 2023
1 parent 954d80a commit 1c6e934
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
3 changes: 0 additions & 3 deletions packages/server/src/api/routes/projects.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ function createRouter(context) {
'/',
handleAsyncError(async (req, res) => {
const unsavedProject = req.body;
if (!unsavedProject.name) {
throw new Error(`missing name field in ${JSON.stringify(req.body, null, 2)}`);
}
const project = await context.storageMethod.createProject(unsavedProject);
res.json(project);
})
Expand Down
1 change: 1 addition & 0 deletions packages/server/src/api/storage/sql/sql.js
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,7 @@ class SqlStorageMethod {
*/
async _createProject(unsavedProject) {
const {projectModel} = this._sql();
if (typeof unsavedProject.name !== 'string') throw new E422('Project name missing');
if (unsavedProject.name.length < 4) throw new E422('Project name too short');
const projectId = uuid.v4();
const adminToken = generateAdminToken();
Expand Down

0 comments on commit 1c6e934

Please sign in to comment.