From 2f5bc8db54841a2f0504d29af9e34771fd6658c1 Mon Sep 17 00:00:00 2001 From: Charlie Humphreys Date: Wed, 21 Dec 2022 16:19:41 -0600 Subject: [PATCH] remove redundant boolean comparison logic --- server/homebrew.api.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/homebrew.api.js b/server/homebrew.api.js index c10e82099..9f006bb70 100644 --- a/server/homebrew.api.js +++ b/server/homebrew.api.js @@ -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.