diff --git a/packages/api/src/index.ts b/packages/api/src/index.ts index b88ff1a..8cac790 100644 --- a/packages/api/src/index.ts +++ b/packages/api/src/index.ts @@ -31,5 +31,6 @@ router.use(apiRouter); app.use(router.routes()).use(router.allowedMethods()); export const server = app.listen(port, () => { + console.info(`Running in ${process.env.NODE_ENV} mode;`); console.info(`Koa app started and listening on port ${port}! 🚀`); }); diff --git a/packages/api/src/modules/users/actions/createUser.ts b/packages/api/src/modules/users/actions/createUser.ts index d568a17..38fbe05 100644 --- a/packages/api/src/modules/users/actions/createUser.ts +++ b/packages/api/src/modules/users/actions/createUser.ts @@ -9,8 +9,8 @@ export const createUser = async ( const isTaken = Boolean( await knex("users") .select("id") - .where({ name: user.name }) - .orWhere({ email: user.email }) + .where({ name: user.name || "" }) + .orWhere({ email: user.email || "" }) .first() ); if (isTaken) return null;