Files
Stephen ZhouandClaude Opus 5.5 ad3083e6f9 chore(web): drop the unused required System Features server lookup
The /datasets/new gate now reads the KnowledgeFS availability endpoint, so nothing
on this branch calls getSystemFeatures.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 11:23:30 +08:00

25 lines
910 B
TypeScript

import { dehydrate } from '@tanstack/react-query'
import { cache } from 'react'
import { getQueryClient } from '@/app/get-query-client'
import { connection } from '@/next/server'
import { consoleQuery } from '@/service/console'
import 'server-only'
const getRequestQueryClient = cache(getQueryClient)
const systemFeaturesServerQueryOptions = () =>
consoleQuery.systemFeatures.get.queryOptions({ staleTime: 'static' })
export const getOptionalSystemFeatures = async () => {
await connection()
const queryClient = getRequestQueryClient()
const queryOptions = systemFeaturesServerQueryOptions()
const queryState = queryClient.getQueryState(queryOptions.queryKey)
if (queryState?.status === 'error' && queryState.data === undefined) return undefined
return queryClient.query(queryOptions).catch(() => undefined)
}
export const dehydrateSystemFeatures = () => dehydrate(getRequestQueryClient())