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

Switch to boolean lock state

This commit is contained in:
G.Ambatte
2024-03-17 21:34:31 +13:00
parent 8f0fb6e458
commit 21c0916693

View File

@@ -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