Initial work on the profile view

This commit is contained in:
Johannes Zellner
2025-01-14 10:27:27 +01:00
parent bffd7c8d24
commit 380791211f
5 changed files with 199 additions and 2 deletions
+27
View File
@@ -0,0 +1,27 @@
import { fetcher } from 'pankow';
function create(origin, accessToken) {
return {
name: 'CloudronModel',
async languages() {
let error, result;
try {
result = await fetcher.get(`${origin}/api/v1/cloudron/languages`, { access_token: accessToken });
} catch (e) {
error = e;
}
if (error || result.status !== 200) {
console.error('Failed to get languages.', error || result.status);
return [];
}
return result.body.languages;
},
};
}
export default {
create,
};