0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-09 09:22:38 +00:00

Merge branch 'master' into addLockRoutes-#3326

This commit is contained in:
G.Ambatte
2024-08-14 08:39:55 +12:00
committed by GitHub
38 changed files with 3366 additions and 2783 deletions

View File

@@ -52,8 +52,8 @@ HomebrewSchema.statics.get = async function(query, fields=null){
return brew;
};
HomebrewSchema.statics.getByUser = async function(username, allowAccess=false, fields=null){
const query = { authors: username, published: true };
HomebrewSchema.statics.getByUser = async function(username, allowAccess=false, fields=null, filter=null){
const query = { authors: username, published: true, ...filter };
if(allowAccess){
delete query.published;
}