diff options
| author | Ivan Chen <ivan@tagg.id> | 2021-03-08 15:48:55 -0500 |
|---|---|---|
| committer | Ivan Chen <ivan@tagg.id> | 2021-03-08 15:48:55 -0500 |
| commit | 7657657c2b8a28b96962ac4fa816bb1625a36e4b (patch) | |
| tree | f5233751e98ee871534473330cf59b518c5c0009 /src/services | |
| parent | 7e5f9c63360f8c4505bb414384e13f8c0f7576e4 (diff) | |
added support for badges
Diffstat (limited to 'src/services')
| -rw-r--r-- | src/services/ExploreService.ts | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/services/ExploreService.ts b/src/services/ExploreService.ts index 33b79b4a..4f7875dc 100644 --- a/src/services/ExploreService.ts +++ b/src/services/ExploreService.ts @@ -67,10 +67,14 @@ export const getAllExploreSections = async () => { } }; -export const getDiscoverUsers = async (id: number) => { +export const getDiscoverUsers = async (id: number, category_type: string) => { try { const token = await AsyncStorage.getItem('token'); - const response = await fetch(DISCOVER_ENDPOINT + `${id}/`, { + let url = DISCOVER_ENDPOINT + `${id}/`; + if (category_type === 'badges') { + url += '?type=badge'; + } + const response = await fetch(url, { method: 'GET', headers: { Authorization: 'Token ' + token, |
