Update load-user.js

This commit is contained in:
Richie Bendall 2020-12-15 06:02:52 +13:00 committed by GitHub
parent de925c2aa5
commit 15fccf45e8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -14,11 +14,9 @@ module.exports = async (request, response, next) => {
}
try {
const userData = await loadJsonFile(path.join(__dirname, '..', 'users', `${response.locals.id}.json`))
response.locals.user = {
...response.locals.user,
...userData
...await loadJsonFile(path.join(__dirname, '..', 'users', `${response.locals.id}.json`))
}
} catch ({ code, message }) {
if (code !== 'ENOENT') {