Skip to content

Commit

Permalink
fix: Always go to recommended version
Browse files Browse the repository at this point in the history
  • Loading branch information
LichtHund committed Jul 10, 2024
1 parent b7974d5 commit 99a4c82
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion backend/src/main/kotlin/website/pages/docs/DocsPage.kt
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public fun Routing.docsRoutes(meili: Meili, developmentMode: Boolean) {

val currentVersion = when {
paramVersion != null -> project.versions[paramVersion] ?: return@get call.respond(HttpStatusCode.NotFound)
else -> project.versions.values.firstOrNull() ?: return@get call.respond(HttpStatusCode.NotFound)
else -> project.versions.values.find { it.recommended } ?: return@get call.respond(HttpStatusCode.NotFound)
}

val pages = currentVersion.pages
Expand Down Expand Up @@ -563,6 +563,7 @@ private fun getProject(project: String): ProjectData? {
reference = entity.reference,
navigation = entity.navigation,
stable = entity.stable,
recommended = entity.recommended,
defaultPage = entity.defaultPage,
github = entity.github,
discord = entity.discord,
Expand Down Expand Up @@ -607,6 +608,7 @@ public data class Version(
public val reference: String,
public val navigation: Navigation,
public val stable: Boolean,
public val recommended: Boolean,
public val pages: Map<String, ProjectPage>,
public val defaultPage: String,
public val github: String?,
Expand Down

0 comments on commit 99a4c82

Please sign in to comment.