fix: search v3 proj type frontend (#5557)

This commit is contained in:
Calum H.
2026-03-13 20:34:26 +00:00
committed by GitHub
parent 86c0937616
commit 4792985e52

View File

@@ -514,10 +514,11 @@ export function useSearch(
}
// Project types
if (projectTypes.value.length === 1) {
parts.push(`project_types = "${projectTypes.value[0]}"`)
} else if (projectTypes.value.length > 1) {
const quoted = projectTypes.value.map((v) => `"${v}"`).join(', ')
const mappedProjectTypes = projectTypes.value.map(mapProjectTypeToSearch)
if (mappedProjectTypes.length === 1) {
parts.push(`project_types = "${mappedProjectTypes[0]}"`)
} else if (mappedProjectTypes.length > 1) {
const quoted = mappedProjectTypes.map((v) => `"${v}"`).join(', ')
parts.push(`project_types IN [${quoted}]`)
}
@@ -754,6 +755,14 @@ export function useSearch(
}
}
const PROJECT_TYPE_SEARCH_MAP: Partial<Record<ProjectType, string>> = {
server: 'minecraft_java_server',
}
function mapProjectTypeToSearch(projectType: ProjectType): string {
return PROJECT_TYPE_SEARCH_MAP[projectType] ?? projectType
}
function getEnvironmentFilterGroups(client: boolean, server: boolean): string[][] {
const groups: string[][] = []
if (client && server) {