From 96b955f2fe5b885cabb4e73b96b6c03422d6f55d Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Thu, 16 May 2024 17:00:26 +1200 Subject: [PATCH] Change lock check to stub.lock from stub.lock.locked --- server/homebrew.api.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/homebrew.api.js b/server/homebrew.api.js index e73a704a8..ef3af9a21 100644 --- a/server/homebrew.api.js +++ b/server/homebrew.api.js @@ -54,7 +54,7 @@ const api = { }); stub = stub?.toObject(); - if(stub?.lock?.locked && accessType != 'edit') { + if(stub?.lock && accessType != 'edit') { throw { HBErrorCode: '100', code: stub.lock.code, message: stub.lock.message, brewId: stub.shareId, brewTitle: stub.title }; } @@ -83,9 +83,9 @@ const api = { if(accessType === 'edit' && (authorsExist && !(isAuthor || isInvited))) { const accessError = { name: 'Access Error', status: 401 }; if(req.account){ - throw { ...accessError, message: 'User is not an Author', HBErrorCode: '03', authors: stub.authors, brewTitle: stub.title, shareId: stub.shareId}; + throw { ...accessError, message: 'User is not an Author', HBErrorCode: '03', authors: stub.authors, brewTitle: stub.title, shareId: stub.shareId }; } - throw { ...accessError, message: 'User is not logged in', HBErrorCode: '04', authors: stub.authors, brewTitle: stub.title, shareId: stub.shareId}; + throw { ...accessError, message: 'User is not logged in', HBErrorCode: '04', authors: stub.authors, brewTitle: stub.title, shareId: stub.shareId }; } // If after all of that we still don't have a brew, throw an exception