databag/net/web/src/api/getGroups.js

14 lines
354 B
JavaScript
Raw Normal View History

2022-04-24 05:47:00 +00:00
import { checkResponse, fetchWithTimeout } from './fetchUtil';
export async function getGroups(token, revision) {
let param = "agent=" + token
if (revision != null) {
param += '&revision=' + revision
}
let groups = await fetchWithTimeout(`/alias/groups?${param}`, { method: 'GET' });
checkResponse(groups)
return await groups.json()
}