0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-24 16:22:44 +00:00

Fix regression with saving.

This commit is contained in:
Trevor Buckner
2021-06-20 16:05:36 -04:00
parent 6ecf546baf
commit d61fda9cff
2 changed files with 2 additions and 1 deletions

View File

@@ -24,6 +24,7 @@ const getBrewFromId = asyncHandler(async (id, accessType)=>{
brew = await GoogleActions.readFileMetadata(config.get('google_api_key'), googleId, id, accessType);
} else {
brew = await HomebrewModel.get(accessType == 'edit' ? { editId: id } : { shareId: id });
brew = brew.toObject(); // Convert MongoDB object to standard Javascript Object
}
brew = sanitizeBrew(brew, accessType === 'edit' ? false : true);

View File

@@ -45,7 +45,7 @@ HomebrewSchema.statics.get = function(query){
}
if(!brews[0].renderer)
brews[0].renderer = 'legacy';
return resolve(brews[0].toObject()); //Convert Mongo Object to JSObject
return resolve(brews[0]);
});
});
};