From 21c0916693e8f1b0408b449d51c679e8c018f688 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Sun, 17 Mar 2024 21:34:31 +1300 Subject: [PATCH] Switch to boolean lock state --- server/homebrew.api.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/server/homebrew.api.js b/server/homebrew.api.js index d0c741a43..567dc9cf7 100644 --- a/server/homebrew.api.js +++ b/server/homebrew.api.js @@ -54,11 +54,8 @@ const api = { }); stub = stub?.toObject(); - if(stub?.lock?.state) { - // State 1 : Locked for everything - // State 2 : Edit only - if(stub.lock.state == 1 || (stub.lock.state == 2 && accessType != 'edit')) - throw { HBErrorCode: '100', code: stub.lock.code, message: stub.lock.message, brewId: accessType === 'edit' ? stub.editId : stub.shareId, brewTitle: stub.title }; + if(stub?.lock?.locked && accessType != 'edit') { + throw { HBErrorCode: '100', code: stub.lock.code, message: stub.lock.message, brewId: stub.shareId, brewTitle: stub.title }; } // If there is a google id, try to find the google brew