fetch latest version tag from docker hub (#11362)
closes #11352 --------- Co-authored-by: Félix Malfait <felix@twenty.com>
This commit is contained in:
-12
@@ -1,12 +0,0 @@
|
||||
export const checkTwentyVersionExists = async (
|
||||
version: string,
|
||||
): Promise<boolean> => {
|
||||
try {
|
||||
const response = await fetch(
|
||||
`https://api.github.com/repos/twentyhq/twenty/releases/tags/v${version}`,
|
||||
);
|
||||
return response.status === 200;
|
||||
} catch (error) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
-11
@@ -1,11 +0,0 @@
|
||||
export const fetchLatestTwentyRelease = async (): Promise<string> => {
|
||||
try {
|
||||
const response = await fetch(
|
||||
'https://api.github.com/repos/twentyhq/twenty/releases/latest',
|
||||
);
|
||||
const data = await response.json();
|
||||
return data.tag_name.replace('v', '');
|
||||
} catch (error) {
|
||||
return 'Could not fetch latest release';
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user