mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-03 23:32:58 +00:00
Switch to use select method
This commit is contained in:
@@ -194,7 +194,18 @@ app.get('/download/:id', asyncHandler(async (req, res)=>{
|
||||
app.get('/user/:username', async (req, res, next)=>{
|
||||
const ownAccount = req.account && (req.account.username == req.params.username);
|
||||
|
||||
const fields = 'title pageCount description authors views shareId editId createdAt updatedAt lastViewed';
|
||||
const fields = [
|
||||
'title',
|
||||
'pageCount',
|
||||
'description',
|
||||
'authors',
|
||||
'views',
|
||||
'shareId',
|
||||
'editId',
|
||||
'createdAt',
|
||||
'updatedAt',
|
||||
'lastViewed'
|
||||
];
|
||||
|
||||
let brews = await HomebrewModel.getByUser(req.params.username, ownAccount, fields)
|
||||
.catch((err)=>{
|
||||
|
||||
Reference in New Issue
Block a user