mirror of
https://github.com/usatiuk/ustk-todolist.git
synced 2025-10-29 08:07:48 +01:00
reformat with prettier,add react frontend submodule
This commit is contained in:
@@ -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 });
|
||||
}),
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user