[ABANDONED] React/Redux front end for the Flexor social network.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

20 lines
545 B

import { fetch } from './fetch'
import { Entity } from '../types/entities'
interface GroupsResponse {
groups: Entity[]
continuation?: string
}
export async function getGroups(sort: string = 'members', continuation?: string) {
const params = {
sort,
continuation,
}
const querystring = Object.entries(params).filter(([name, value]) => value !== undefined).map(([name, value]) => `${name}=${value}`).join('&')
return await fetch<GroupsResponse>({
path: `/api/groups?${querystring}`
})
}