diff options
author | Ivan Chen <ivan@tagg.id> | 2021-03-25 12:26:28 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-25 12:26:28 -0400 |
commit | e2fd6a1ccaa26eb2e8e7e3472c88e75cbc41fedd (patch) | |
tree | 4d69b8598ef86e9a747a179ff6b71c7f1f723fc3 /src/services/ExploreService.ts | |
parent | 24a3e50c62df4f9c64a103154af2746c1f2ce8d0 (diff) | |
parent | 35ebcd4da8471c9dbdd6bf7923ab06d66db9d364 (diff) |
Merge pull request #327 from IvanIFChen/tma726-remove-new-to-tagg
[TMA-726] Remove new to tagg
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'); |