Use concrete resource name instead of generic "resource"

This commit is contained in:
Girish Ramakrishnan
2021-09-20 22:39:35 -07:00
parent d1e8fded65
commit 0cfc3e03bb
4 changed files with 85 additions and 85 deletions

View File

@@ -33,7 +33,7 @@ async function load(req, res, next) {
const [error, result] = await safe(users.get(req.params.userId));
if (error) return next(BoxError.toHttpError(error));
if (!result) return next(new HttpError(404, 'User not found'));
req.resource = result;
req.resource = result; // this is not req.user because req.user is already the authenticated user
next();
}