diff options
author | Ivan Chen <ivan@tagg.id> | 2021-03-26 15:33:37 -0400 |
---|---|---|
committer | Ivan Chen <ivan@tagg.id> | 2021-03-26 15:33:37 -0400 |
commit | 9be7248ba54eeb2ad4d19edd4c01ee736b58bfcd (patch) | |
tree | 6f66b86bbe9adaffb7d866b22a89e0e3f78f26a3 /src/services/ExploreService.ts | |
parent | 883a6c51d4c3e442df5e6c0f3dc6fada2f370f8e (diff) | |
parent | 99de9c8402f470ead242a81510dc2764ae7d9e66 (diff) |
Merge branch 'master' into tma728-select-school-onboarding
# Conflicts:
# src/services/UserProfileService.ts
# src/types/types.ts
Diffstat (limited to 'src/services/ExploreService.ts')
-rw-r--r-- | src/services/ExploreService.ts | 37 |
1 files changed, 1 insertions, 36 deletions
diff --git a/src/services/ExploreService.ts b/src/services/ExploreService.ts index 07af91ad..44df8056 100644 --- a/src/services/ExploreService.ts +++ b/src/services/ExploreService.ts @@ -4,12 +4,7 @@ import { DISCOVER_ENDPOINT, SEARCH_BUTTONS_ENDPOPINT, } from '../constants'; -import {EMPTY_PROFILE_PREVIEW_LIST} from '../store/initialStates'; -import { - ExploreSectionType, - ProfilePreviewType, - SearchCategoryType, -} from '../types'; +import {ProfilePreviewType, SearchCategoryType} from '../types'; export const getAllTaggUsers = async (token: string) => { try { @@ -38,36 +33,6 @@ export const getAllTaggUsers = async (token: string) => { } }; -export const getAllExploreSections = async () => { - try { - const token = await AsyncStorage.getItem('token'); - const response = await fetch(DISCOVER_ENDPOINT, { - method: 'GET', - headers: { - Authorization: 'Token ' + token, - }, - }); - if (response.status !== 200) { - return EMPTY_PROFILE_PREVIEW_LIST; - } - const data = await response.json(); - // TODO (if we return to original explore format): get keys from backend API - const exploreSections: Record<ExploreSectionType, ProfilePreviewType[]> = { - 'New to Tagg': data.categories.new_to_tagg, - 'People You May Know': data.categories.people_you_may_know, - 'Trending on Tagg': data.categories.trending_on_tagg, - "Brown '21": data.categories.brown_21, - "Brown '22": data.categories.brown_22, - "Brown '23": data.categories.brown_23, - "Brown '24": data.categories.brown_24, - }; - - return exploreSections; - } catch (error) { - console.log('Unable to fetch explore data'); - } -}; - export const getDiscoverUsers = async (categoryName: string) => { try { const token = await AsyncStorage.getItem('token'); |