0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-07 16:22:42 +00:00

change back prop names

This commit is contained in:
Víctor Losada Hernández
2024-08-13 12:00:58 +02:00
parent 8faae1e645
commit 62b96f4e79

View File

@@ -75,6 +75,7 @@ const VaultPage = (props) => {
const performSearch = async ({ title, author, count, v3, legacy }) => { const performSearch = async ({ title, author, count, v3, legacy }) => {
updateUrl(title, author, count, v3, legacy, page); updateUrl(title, author, count, v3, legacy, page);
console.log(title, author, count, v3, legacy);
if ((title || author) && (v3 || legacy)) { if ((title || author) && (v3 || legacy)) {
try { try {
const response = await request.get( const response = await request.get(
@@ -125,25 +126,26 @@ const VaultPage = (props) => {
} }
}; };
const titleValue = titleRef.current.value || ''; const title = titleRef.current.value || '';
const authorValue = authorRef.current.value || ''; const author = authorRef.current.value || '';
const countValue = countRef.current.value || 10; const count = countRef.current.value || 10;
const v3Value = v3Ref.current.checked != false; const v3 = v3Ref.current.checked != false;
const legacyValue = legacyRef.current.checked != false; const legacy = legacyRef.current.checked != false;
console.log(title);
if (update) { if (update) {
setTitle(titleValue); setTitle(title);
setAuthor(authorValue); setAuthor(author);
setCount(countValue); setCount(count);
setV3(v3Value); setV3(v3);
setLegacy(legacyValue); setLegacy(legacy);
} }
// Perform search with the latest input values, because state is not fast enough // Perform search with the latest input values, because state is not fast enough
performSearch({ titleValue, authorValue, countValue, v3Value, legacyValue }); performSearch({ title, author, count, v3, legacy });
if (total) { if (total) {
loadTotal({ titleValue, authorValue, v3Value, legacyValue }); loadTotal({ title, author, v3, legacy });
} }
}; };