Bring back deep linking in appstore to install specific versions

This commit is contained in:
Johannes Zellner
2025-01-08 14:16:17 +01:00
parent 68e02817a0
commit 7d56e71f77
4 changed files with 45 additions and 8 deletions
+18
View File
@@ -19,6 +19,24 @@ function create(origin, accessToken) {
return result.body.apps;
},
async get(id, version = '') {
let url = `${origin}/api/v1/appstore/apps/${id}`;
if (version && version !== 'latest') url += `/versions/${version}`;
let error, result;
try {
result = await fetcher.get(url, { access_token: accessToken });
} catch (e) {
error = e;
}
if (error || result.status !== 200) {
console.error('Failed to get app.', error || result.status);
return null;
}
return result.body;
},
};
}