This commit is contained in:
FRC 2022-09-06 14:17:21 +01:00 committed by GitHub
parent 450b140f5f
commit 59f3936dad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -104,7 +104,7 @@ export async function listContracts(creatorId: string): Promise<Contract[]> {
return snapshot.docs.map((doc) => doc.data())
}
export const contractsByGroupSlugQuery = (slug: string) =>
export const tournamentContractsByGroupSlugQuery = (slug: string) =>
query(
contracts,
where('groupSlugs', 'array-contains', slug),
@ -115,7 +115,8 @@ export const contractsByGroupSlugQuery = (slug: string) =>
export async function listContractsByGroupSlug(
slug: string
): Promise<Contract[]> {
const snapshot = await getDocs(contractsByGroupSlugQuery(slug))
const q = query(contracts, where('groupSlugs', 'array-contains', slug))
const snapshot = await getDocs(q)
return snapshot.docs.map((doc) => doc.data())
}

View File

@ -14,7 +14,7 @@ import { Col } from 'web/components/layout/col'
import { Row } from 'web/components/layout/row'
import { Page } from 'web/components/page'
import { SEO } from 'web/components/SEO'
import { contractsByGroupSlugQuery } from 'web/lib/firebase/contracts'
import { tournamentContractsByGroupSlugQuery } from 'web/lib/firebase/contracts'
import { getGroup, groupPath } from 'web/lib/firebase/groups'
import elon_pic from './_cspi/Will_Elon_Buy_Twitter.png'
import china_pic from './_cspi/Chinese_Military_Action_against_Taiwan.png'
@ -222,7 +222,7 @@ const ImageCarousel = (props: { images: MarketImage[]; url: string }) => {
const MarketCarousel = (props: { slug: string }) => {
const { slug } = props
const q = contractsByGroupSlugQuery(slug)
const q = tournamentContractsByGroupSlugQuery(slug)
const { allItems, getNext } = usePagination({ q, pageSize: 6 })
const items = allItems()