chore: Do not override query method for findOne query errors

This commit is contained in:
Faruk AYDIN
2021-11-28 22:45:23 +01:00
committed by Ömer Faruk Aydın
parent 3e4768c106
commit 79b12ac9e6
10 changed files with 10 additions and 17 deletions

View File

@@ -6,7 +6,7 @@ const authentication = async (req: RequestWithCurrentUser, _res: Response, next:
// We set authentication to use the sample user we created temporarily.
req.currentUser = await User.query().findOne({
email: 'user@automatisch.com'
})
}).throwIfNotFound();
next()
}