mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 09:25:06 +03:00
fix: search on the partners/integrations page was still using misc db (#45866)
The `INTEGRATIONS_MARKETPLACE_DB` was not included in the client bundle (because it doesn't start with `NEXT_PUBLIC_`) which caused the client side search functions on the https://supabase.com/partners/integrations page to keep using the older misc db for search. Steps to reproduce: * Go to the https://supabase.com/partners/integrations page. * Search for `aikido`. * Click the only tile found for this search term. Notice that it takes you to `https://supabase.com/partners/integrations/aikido-security` which 404s. This is because that slug (`aikido-security`) is coming from the old misc db. The correct slug in the new db is `aikido`. Other fixes: * Corrected the tsv column name from `tsv` to `listing_tsv`. * Fixed search debouncing.
This commit is contained in:
1 parent
bcfc666284
commit
9e0feb5740
4 files changed
+10
-13
No files matched your search
@@ -2,7 +2,7 @@
|
||||
CMS_API_KEY=secret
|
||||
CMS_PREVIEW_SECRET=secret
|
||||
HCAPTCHA_SECRET_KEY=0x0000000000000000000000000000000000000000
|
||||
INTEGRATIONS_MARKETPLACE_DB=true
|
||||
NEXT_PUBLIC_INTEGRATIONS_MARKETPLACE_DB=true
|
||||
MISC_USE_SERVICE_ROLE_KEY=secret
|
||||
NEXT_PUBLIC_API_URL=http://localhost:8080/platform
|
||||
NEXT_PUBLIC_DESIGN_SYSTEM_URL=http://localhost:3003
|
||||
|
||||
@@ -6,7 +6,8 @@ import supabase from './supabaseMisc'
|
||||
// Switch between new Marketplace DB and legacy Supabase Misc DB by updating the environment var
|
||||
// in the Vercel deployment and redeploying, as that will take effect more quickly than flipping a
|
||||
// feature flag in ConfigCat and waiting for the revalidate timeout.
|
||||
const isUseMarketplaceDb = process.env.INTEGRATIONS_MARKETPLACE_DB?.toLowerCase() === 'true'
|
||||
const isUseMarketplaceDb =
|
||||
process.env.NEXT_PUBLIC_INTEGRATIONS_MARKETPLACE_DB?.toLowerCase() === 'true'
|
||||
|
||||
const marketplaceClient = createMarketplaceClient()
|
||||
|
||||
@@ -103,7 +104,7 @@ async function searchMarketplaceListings(search: string): Promise<Partner[] | nu
|
||||
let query = marketplaceClient.from('listings').select('*').is('publish_marketplace', true)
|
||||
|
||||
if (search.trim()) {
|
||||
query = query.textSearch('tsv', `${search.trim()}`, {
|
||||
query = query.textSearch('listing_tsv', `${search.trim()}`, {
|
||||
type: 'websearch',
|
||||
config: 'english',
|
||||
})
|
||||
|
||||
@@ -28,7 +28,7 @@ interface Props {
|
||||
}
|
||||
|
||||
function IntegrationPartnersPage(props: Props) {
|
||||
const initialPartners = props.partners ?? []
|
||||
const initialPartners = props.partners
|
||||
const [partners, setPartners] = useState(initialPartners)
|
||||
|
||||
const categoryMap: { [slug: string]: Category } = {}
|
||||
@@ -53,25 +53,21 @@ function IntegrationPartnersPage(props: Props) {
|
||||
const [isSearching, setIsSearching] = useState(false)
|
||||
|
||||
useEffect(() => {
|
||||
const doSearch = async () => {
|
||||
setIsSearching(true)
|
||||
return await searchPartners(search)
|
||||
}
|
||||
|
||||
if (search.trim() === '') {
|
||||
if (debouncedSearchTerm.trim() === '') {
|
||||
setIsSearching(false)
|
||||
setPartners(initialPartners)
|
||||
return
|
||||
}
|
||||
|
||||
doSearch().then((partners) => {
|
||||
setIsSearching(true)
|
||||
searchPartners(debouncedSearchTerm).then((partners) => {
|
||||
if (partners) {
|
||||
setPartners(partners)
|
||||
}
|
||||
|
||||
setIsSearching(false)
|
||||
})
|
||||
}, [debouncedSearchTerm, router])
|
||||
}, [debouncedSearchTerm, initialPartners])
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
"VERCEL",
|
||||
"VERCEL_ENV",
|
||||
"VERCEL_GIT_COMMIT_SHA",
|
||||
"INTEGRATIONS_MARKETPLACE_DB",
|
||||
"NEXT_PUBLIC_INTEGRATIONS_MARKETPLACE_DB",
|
||||
"NEXT_PUBLIC_MARKETPLACE_API_URL",
|
||||
"NEXT_PUBLIC_MARKETPLACE_PUBLISHABLE_KEY",
|
||||
// These envs are used in the packages
|
||||
|
||||
Reference in new issue
Block a user