aboutsummaryrefslogtreecommitdiff
path: root/src/services/ExploreService.ts
diff options
context:
space:
mode:
authorIvan Chen <ivan@tagg.id>2021-03-08 20:53:03 -0500
committerGitHub <noreply@github.com>2021-03-08 20:53:03 -0500
commit5298bb3a1620f6906af5041bfe15d1ac7b6325d9 (patch)
treebb0df686ffdb8afe16c242532c6dcfd7038c7018 /src/services/ExploreService.ts
parentd77f43663fbe409b011b5509bcbff3d07f8ded55 (diff)
parent64a454efe603455f17a401a9d2c75e72f22c1f4f (diff)
Merge pull request #287 from IvanIFChen/tma684-search-for-badges
[TMA-684] Support to Search Badges
Diffstat (limited to 'src/services/ExploreService.ts')
-rw-r--r--src/services/ExploreService.ts8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/services/ExploreService.ts b/src/services/ExploreService.ts
index 56a2e3d1..9b0b4f71 100644
--- a/src/services/ExploreService.ts
+++ b/src/services/ExploreService.ts
@@ -68,10 +68,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,