Skip to content

Commit 15d64ac

Browse files
committed
fix: search v3 proj type frontend
1 parent b2d40af commit 15d64ac

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

packages/ui/src/utils/search.ts

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -514,10 +514,11 @@ export function useSearch(
514514
}
515515

516516
// Project types
517-
if (projectTypes.value.length === 1) {
518-
parts.push(`project_types = "${projectTypes.value[0]}"`)
519-
} else if (projectTypes.value.length > 1) {
520-
const quoted = projectTypes.value.map((v) => `"${v}"`).join(', ')
517+
const mappedProjectTypes = projectTypes.value.map(mapProjectTypeToSearch)
518+
if (mappedProjectTypes.length === 1) {
519+
parts.push(`project_types = "${mappedProjectTypes[0]}"`)
520+
} else if (mappedProjectTypes.length > 1) {
521+
const quoted = mappedProjectTypes.map((v) => `"${v}"`).join(', ')
521522
parts.push(`project_types IN [${quoted}]`)
522523
}
523524

@@ -754,6 +755,14 @@ export function useSearch(
754755
}
755756
}
756757

758+
const PROJECT_TYPE_SEARCH_MAP: Partial<Record<ProjectType, string>> = {
759+
server: 'minecraft_java_server',
760+
}
761+
762+
function mapProjectTypeToSearch(projectType: ProjectType): string {
763+
return PROJECT_TYPE_SEARCH_MAP[projectType] ?? projectType
764+
}
765+
757766
function getEnvironmentFilterGroups(client: boolean, server: boolean): string[][] {
758767
const groups: string[][] = []
759768
if (client && server) {

0 commit comments

Comments
 (0)