Add applink dialog in apps view

This commit is contained in:
Johannes Zellner
2025-01-03 15:06:41 +01:00
parent 56739945fa
commit 27fac748cd
7 changed files with 399 additions and 10 deletions
+27
View File
@@ -0,0 +1,27 @@
import { fetcher } from 'pankow';
function create(origin, accessToken) {
return {
name: 'GroupsModel',
async list() {
let error, result;
try {
result = await fetcher.get(`${origin}/api/v1/groups`, { access_token: accessToken });
} catch (e) {
error = e;
}
if (error || result.status !== 200) {
console.error('Failed to list groups.', error || result.status);
return [];
}
return result.body.groups;
},
};
}
export default {
create,
};