Skip to content
This repository has been archived by the owner on Jul 31, 2024. It is now read-only.

Commit

Permalink
fix: undefined bindings in createuser action
Browse files Browse the repository at this point in the history
  • Loading branch information
vycdev committed Jul 9, 2020
1 parent 23dcee9 commit 812580b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/api/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}! 🚀`);
});
4 changes: 2 additions & 2 deletions packages/api/src/modules/users/actions/createUser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ export const createUser = async (
const isTaken = Boolean(
await knex<User>("users")
.select("id")
.where({ name: user.name })
.orWhere({ email: user.email })
.where({ name: user.name || "" })
.orWhere({ email: user.email || "" })
.first()
);
if (isTaken) return null;
Expand Down

0 comments on commit 812580b

Please sign in to comment.