Skip to content

Commit

Permalink
if endpoint only returns one collection as a hash, force array
Browse files Browse the repository at this point in the history
  • Loading branch information
avertrees committed Dec 5, 2024
1 parent ba7a2a8 commit 18ff185
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/src/components/pages/collectionsPage/collectionsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ export const CollectionsPage = ({ data }) => {
const searchParams = useSearchParams();
const pathname = usePathname();
const [isLoaded, setIsLoaded] = useState(false);
// console.log("typeof data.collection is: ", typeof data.collection)
// console.log(" data.collection.length? ", typeof data.collection?.length)

const collections = data.collection; //typeof data.collection === "array" ? data.collection : [data.collection] //: data.collection // this breaks empty search
const collections = Array.isArray(data.collection)
? data.collection
: [data.collection];
const headingRef = useRef<HTMLHeadingElement>(null);

// pagination
Expand Down

0 comments on commit 18ff185

Please sign in to comment.