0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-24 18:32:41 +00:00

Remove unnecessary variable

This commit is contained in:
G.Ambatte
2025-04-09 10:48:02 +12:00
parent b19d05fbf7
commit bd68b9c0cb

View File

@@ -209,9 +209,6 @@ router.post('/api/lock/:id', mw.adminOnly, asyncHandler(async (req, res)=>{
const lock = req.body;
const overwrite = lock.overwrite || false;
lock.overwrite = undefined;
lock.applied = new Date;
const filter = {
@@ -222,10 +219,12 @@ router.post('/api/lock/:id', mw.adminOnly, asyncHandler(async (req, res)=>{
if(!brew) throw { name: 'Brew Not Found', message: 'Cannot find brew to lock', shareId: req.params.id, status: 500, HBErrorCode: '63' };
if(brew.lock && !overwrite) {
if(brew.lock && !lock.overwrite) {
throw { name: 'Already Locked', message: 'Lock already exists on brew', shareId: req.params.id, title: brew.title, status: 500, HBErrorCode: '64' };
}
lock.overwrite = undefined;
brew.lock = lock;
brew.markModified('lock');