0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-31 17:22:45 +00:00

Clean up tests

This commit is contained in:
Trevor Buckner
2023-02-18 13:48:02 -05:00
parent 1fb7fe2487
commit 298a10bc42
3 changed files with 4 additions and 11 deletions

View File

@@ -317,13 +317,7 @@ If you believe you should have access to this brew, ask the file owner to invite
brew.textBin = zlib.deflateRawSync(brew.text);
brew.text = undefined;
}
// Otherwise, save the brew with updated author list
// markModified() is necessary to have Mongoose reduce the array length in the database
// Without it, starting with an array of ['A', 'B', 'C'] in the database:
// - when reduced to ['A', 'B'] will result in ['A', 'B', 'C'] saved in the database
// - when reduced to ['B', 'C'] will result in ['B', 'C', 'C'] saved in the database
brew.markModified('authors');
brew.markModified('authors'); //Mongo will not properly update arrays without markModified()
await brew.save()
.catch((err)=>{
throw { status: 500, message: err };