0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-04 01:42:42 +00:00

Merge branch 'master' into google-document-stubs

This commit is contained in:
Charlie Humphreys
2022-05-11 23:35:31 -05:00
4 changed files with 1631 additions and 2736 deletions

View File

@@ -164,7 +164,20 @@ app.get('/download/:id', asyncHandler(getBrew('share')), (req, res)=>{
app.get('/user/:username', async (req, res, next)=>{
const ownAccount = req.account && (req.account.username == req.params.username);
let brews = await HomebrewModel.getByUser(req.params.username, ownAccount)
const fields = [
'title',
'pageCount',
'description',
'authors',
'views',
'shareId',
'editId',
'createdAt',
'updatedAt',
'lastViewed'
];
let brews = await HomebrewModel.getByUser(req.params.username, ownAccount, fields)
.catch((err)=>{
console.log(err);
});