Skip to content

Commit

Permalink
fix: types releases latest
Browse files Browse the repository at this point in the history
  • Loading branch information
hywax committed Mar 17, 2024
1 parent 9762d64 commit bce1c92
Showing 1 changed file with 41 additions and 1 deletion.
42 changes: 41 additions & 1 deletion src/server/api/update.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,47 @@
import currentPackage from '~~/package.json'

export interface ReleasesLatest {
url: string
assets_url: string
upload_url: string
html_url: string
id: number
author: {
login: string
id: number
node_id: string
avatar_url: string
gravatar_id: string
url: string
html_url: string
followers_url: string
following_url: string
gists_url: string
starred_url: string
subscriptions_url: string
organizations_url: string
repos_url: string
events_url: string
received_events_url: string
type: string
site_admin: boolean
}
node_id: string
tag_name: string
target_commitish: string
name: string
draft: boolean
prerelease: boolean
created_at: string
published_at: string
assets: Array<any>
tarball_url: string
zipball_url: string
body: string
}

export default defineEventHandler(async () => {
const latestReleases = await $fetch<typeof currentPackage>('https://api.github.com/repos/hywax/mafl/releases/latest', {
const latestReleases = await $fetch<ReleasesLatest>('https://api.github.com/repos/hywax/mafl/releases/latest', {
parseResponse: (json) => JSON.parse(json),
})
const latestVersion = latestReleases.tag_name.replace('v', '')
Expand Down

0 comments on commit bce1c92

Please sign in to comment.