reformat with prettier,add react frontend submodule

This commit is contained in:
2018-06-03 12:47:23 +03:00
parent 38688491f9
commit bbee6b2b95
16 changed files with 255 additions and 58 deletions

View File

@@ -35,7 +35,10 @@ router.delete(
'/:listId',
asyncHelper(async (req, res) => {
const { listId } = req.params;
const list = await TodoList.findOne({ _id: listId, user: req.user.id }).exec();
const list = await TodoList.findOne({
_id: listId,
user: req.user.id,
}).exec();
await list.remove();
res.json({ success: true });
}),

View File

@@ -47,7 +47,9 @@ router.patch(
{ runValidators: true, context: 'query', new: true },
).exec();
if (!user) {
throw new NotFoundError(`can't find user with username ${req.user.username}`);
throw new NotFoundError(
`can't find user with username ${req.user.username}`,
);
}
if (password !== undefined) {
await user.setPassword(password);