mirror of
https://github.com/supabase/supabase.git
synced 2026-10-11 12:25:05 +03:00
Updates the marketplace DB query to use the new `publish_dashboard` column that was added in https://github.com/supabase/marketplace/pull/49 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Updated internal marketplace integration query and database type definitions to streamline listing management logic. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
27 lines
753 B
TypeScript
27 lines
753 B
TypeScript
import { queryOptions } from '@tanstack/react-query'
|
|
import { createMarketplaceClient } from 'common/marketplace-client'
|
|
|
|
import { marketplaceIntegrationsKeys } from './keys'
|
|
import { handleError } from '@/data/fetchers'
|
|
|
|
async function getMarketplaceIntegrations() {
|
|
const marketplaceClient = createMarketplaceClient()
|
|
const { data, error } = await marketplaceClient
|
|
.from('listings')
|
|
.select('*')
|
|
.is('publish_dashboard', true)
|
|
|
|
if (error) handleError(error)
|
|
return data ?? []
|
|
}
|
|
|
|
export const marketplaceIntegrationsQueryOptions = ({
|
|
enabled = true,
|
|
}: { enabled?: boolean } = {}) => {
|
|
return queryOptions({
|
|
queryKey: marketplaceIntegrationsKeys.list(),
|
|
queryFn: () => getMarketplaceIntegrations(),
|
|
enabled,
|
|
})
|
|
}
|