fix: search v3 proj type frontend (#5557)
This commit is contained in:
@@ -514,10 +514,11 @@ export function useSearch(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Project types
|
// Project types
|
||||||
if (projectTypes.value.length === 1) {
|
const mappedProjectTypes = projectTypes.value.map(mapProjectTypeToSearch)
|
||||||
parts.push(`project_types = "${projectTypes.value[0]}"`)
|
if (mappedProjectTypes.length === 1) {
|
||||||
} else if (projectTypes.value.length > 1) {
|
parts.push(`project_types = "${mappedProjectTypes[0]}"`)
|
||||||
const quoted = projectTypes.value.map((v) => `"${v}"`).join(', ')
|
} else if (mappedProjectTypes.length > 1) {
|
||||||
|
const quoted = mappedProjectTypes.map((v) => `"${v}"`).join(', ')
|
||||||
parts.push(`project_types IN [${quoted}]`)
|
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[][] {
|
function getEnvironmentFilterGroups(client: boolean, server: boolean): string[][] {
|
||||||
const groups: string[][] = []
|
const groups: string[][] = []
|
||||||
if (client && server) {
|
if (client && server) {
|
||||||
|
|||||||
Reference in New Issue
Block a user