mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2025-12-24 18:32:41 +00:00
remove redundant boolean comparison logic
This commit is contained in:
@@ -58,8 +58,8 @@ const getBrew = (accessType, stubOnly = false)=>{
|
||||
stub = stub ? _.assign({ ...excludeStubProps(stub), stubbed: true }, excludeGoogleProps(googleBrew)) : googleBrew;
|
||||
}
|
||||
const authorsExist = stub?.authors?.length > 0;
|
||||
const isAuthor = (stub?.authors || [])?.includes(req.account?.username);
|
||||
const isInvited = (stub?.invitedAuthors || []).includes(req.account?.username);
|
||||
const isAuthor = stub?.authors?.includes(req.account?.username);
|
||||
const isInvited = stub?.invitedAuthors?.includes(req.account?.username);
|
||||
if(accessType === 'edit' && (authorsExist && (!isAuthor || !isInvited))) {
|
||||
throw `The current logged in user does not have editor access to this brew.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user