From 336391659200528f33d56820a9dd19045eb27d03 Mon Sep 17 00:00:00 2001 From: david g Date: Tue, 31 Oct 2023 09:51:29 -0400 Subject: [PATCH] Simplified empty params --- react-app/src/api/usePersistedQueries.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/react-app/src/api/usePersistedQueries.js b/react-app/src/api/usePersistedQueries.js index 2e6972b..78fa5b5 100644 --- a/react-app/src/api/usePersistedQueries.js +++ b/react-app/src/api/usePersistedQueries.js @@ -9,9 +9,7 @@ it. import { useEffect, useState, useMemo } from "react"; import aemHeadlessClient from "./aemHeadlessClient"; -import { parseArgs } from "util"; -const emptyObject = useMemo({}); /** * This file contains the React useEffect custom hooks that: * 1. Are called by the React components @@ -62,8 +60,6 @@ async function fetchPersistedQuery(persistedQueryName, queryParameters) { * @returns an array of Adventure JSON objects, and array of errors */ export function useAdventuresByActivity(adventureActivity, params) { - - params = params || emptyObject; const [adventures, setAdventures] = useState(null); const [errors, setErrors] = useState(null); @@ -108,7 +104,6 @@ export function useAdventuresByActivity(adventureActivity, params) { * @returns a JSON object representing the Adventure */ export function useAdventureBySlug(slugName, params) { - params = params || emptyObject; const [adventure, setAdventure] = useState(null); const [references, setReferences] = useState(null); const [errors, setErrors] = useState(null);