Fix bug (#854)
This commit is contained in:
		
							parent
							
								
									450b140f5f
								
							
						
					
					
						commit
						59f3936dad
					
				|  | @ -104,7 +104,7 @@ export async function listContracts(creatorId: string): Promise<Contract[]> { | ||||||
|   return snapshot.docs.map((doc) => doc.data()) |   return snapshot.docs.map((doc) => doc.data()) | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| export const contractsByGroupSlugQuery = (slug: string) => | export const tournamentContractsByGroupSlugQuery = (slug: string) => | ||||||
|   query( |   query( | ||||||
|     contracts, |     contracts, | ||||||
|     where('groupSlugs', 'array-contains', slug), |     where('groupSlugs', 'array-contains', slug), | ||||||
|  | @ -115,7 +115,8 @@ export const contractsByGroupSlugQuery = (slug: string) => | ||||||
| export async function listContractsByGroupSlug( | export async function listContractsByGroupSlug( | ||||||
|   slug: string |   slug: string | ||||||
| ): Promise<Contract[]> { | ): 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()) |   return snapshot.docs.map((doc) => doc.data()) | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -14,7 +14,7 @@ import { Col } from 'web/components/layout/col' | ||||||
| import { Row } from 'web/components/layout/row' | import { Row } from 'web/components/layout/row' | ||||||
| import { Page } from 'web/components/page' | import { Page } from 'web/components/page' | ||||||
| import { SEO } from 'web/components/SEO' | 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 { getGroup, groupPath } from 'web/lib/firebase/groups' | ||||||
| import elon_pic from './_cspi/Will_Elon_Buy_Twitter.png' | import elon_pic from './_cspi/Will_Elon_Buy_Twitter.png' | ||||||
| import china_pic from './_cspi/Chinese_Military_Action_against_Taiwan.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 MarketCarousel = (props: { slug: string }) => { | ||||||
|   const { slug } = props |   const { slug } = props | ||||||
|   const q = contractsByGroupSlugQuery(slug) |   const q = tournamentContractsByGroupSlugQuery(slug) | ||||||
|   const { allItems, getNext } = usePagination({ q, pageSize: 6 }) |   const { allItems, getNext } = usePagination({ q, pageSize: 6 }) | ||||||
|   const items = allItems() |   const items = allItems() | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user