mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2025-12-24 18:32:41 +00:00
Initial functionality pass
This commit is contained in:
@@ -122,6 +122,16 @@ const errorIndex = (props)=>{
|
||||
An error occurred while attempting to remove the user from the Homebrewery document author list!
|
||||
|
||||
**Brew ID:** ${props.brew.brewId}`,
|
||||
|
||||
// Brew locked by Administrators error
|
||||
'100' : dedent`
|
||||
## This brew has been locked.
|
||||
|
||||
Please contact the Administrators to unlock this document.
|
||||
|
||||
**Brew ID:** ${props.brew.brewId}
|
||||
|
||||
**Brew Title:** ${props.brew.brewTitle}`,
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -54,6 +54,13 @@ 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 there is a google id, try to find the google brew
|
||||
if(!stubOnly && (googleId || stub?.googleId)) {
|
||||
let googleError;
|
||||
|
||||
Reference in New Issue
Block a user