diff --git a/server/api/getLatestRelease.ts b/server/api/getLatestRelease.ts index 70325c0c6..b17ec213e 100644 --- a/server/api/getLatestRelease.ts +++ b/server/api/getLatestRelease.ts @@ -9,11 +9,12 @@ export default defineEventHandler(async () => { # eslint-disable-next-line @graphql-eslint/fields-on-correct-type repository(owner: "JabRef", name: "jabref") { releases( - first: 1 + first: 5 orderBy: { field: CREATED_AT, direction: DESC } ) { nodes { tagName + isPrerelease } } } @@ -27,15 +28,15 @@ export default defineEventHandler(async () => { releases?: { nodes: { tagName: string + isPrerelease: boolean }[] } } } } return { - version: response.data?.repository?.releases?.nodes[0].tagName.replace( - 'v', - '', - ), // something like 5.7 + version: response.data?.repository?.releases?.nodes + .find((release) => !release.isPrerelease) + ?.tagName.replace('v', ''), // something like 5.7 } })