From a1e585ccaac05be7bdfa5f1928394e35c24e0687 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Wed, 4 Sep 2024 00:43:12 -0400 Subject: [PATCH] Remove redundant validation check `performSearch()` and `loadTotal()` shouldn't need a separate check for valid items if `loadPage` already does it through `validateForm` --- client/homebrew/pages/vaultPage/vaultPage.jsx | 5 ----- 1 file changed, 5 deletions(-) diff --git a/client/homebrew/pages/vaultPage/vaultPage.jsx b/client/homebrew/pages/vaultPage/vaultPage.jsx index b4d1914f6..d1362f13a 100644 --- a/client/homebrew/pages/vaultPage/vaultPage.jsx +++ b/client/homebrew/pages/vaultPage/vaultPage.jsx @@ -60,8 +60,6 @@ const VaultPage = (props) => { const performSearch = async (title, author, count, v3, legacy, page) => { updateUrl(title, author, count, v3, legacy, page); - if (!((title || author) && (v3 || legacy))) - return; const response = await request.get( `/api/vault?title=${title}&author=${author}&v3=${v3}&legacy=${legacy}&count=${count}&page=${page}` @@ -80,8 +78,6 @@ const VaultPage = (props) => { const loadTotal = async (title, author, v3, legacy) => { setTotalBrews(null); - if (!((title || author) && (v3 || legacy))) - return; const response = await request.get( `/api/vault/total?title=${title}&author=${author}&v3=${v3}&legacy=${legacy}` @@ -135,7 +131,6 @@ const VaultPage = (props) => { const validateForm = () => { //form validity: title or author must be written, and at least one renderer set - const isTitleValid = titleRef.current.validity.valid && titleRef.current.value; const isAuthorValid = authorRef.current.validity.valid && authorRef.current.value; const isCheckboxChecked = legacyRef.current.checked || v3Ref.current.checked;