mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-06 16:03:52 +00:00
20 lines
419 B
TypeScript
20 lines
419 B
TypeScript
import axios from 'axios';
|
|
|
|
import { apiRepoLatest } from '../../externals';
|
|
|
|
export type HasUpdate = {
|
|
url: string;
|
|
version: string;
|
|
};
|
|
|
|
/**
|
|
* HTTP request to get the latest version and url from github
|
|
*/
|
|
export async function getLatestVersion(): Promise<HasUpdate> {
|
|
const res = await axios.get(apiRepoLatest);
|
|
return {
|
|
url: res.data.html_url as string,
|
|
version: res.data.tag_name as string,
|
|
};
|
|
}
|