From 7657657c2b8a28b96962ac4fa816bb1625a36e4b Mon Sep 17 00:00:00 2001 From: Ivan Chen Date: Mon, 8 Mar 2021 15:48:55 -0500 Subject: added support for badges --- src/services/ExploreService.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/services') 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, -- cgit v1.2.3-70-g09d2