diff options
| author | Shravya Ramesh <37447613+shravyaramesh@users.noreply.github.com> | 2020-11-20 13:20:49 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-20 16:20:49 -0500 |
| commit | 3214fc765cbce3c6f9092546424249d08622afb1 (patch) | |
| tree | 862aa8872d670195f2a33264f672782ea1077c9c /src/services/ExploreServices.ts | |
| parent | 713d169915a82edfcfe4b44622e3dce8c6adaf0c (diff) | |
[TMA-375] Added discover users to explore (#119)
* Added discover users to explore
* Filtered following users out
* Removed reload button and filtering following users from discover page
* Wrapped contents
* Preview type in types.ts
Diffstat (limited to 'src/services/ExploreServices.ts')
| -rw-r--r-- | src/services/ExploreServices.ts | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/services/ExploreServices.ts b/src/services/ExploreServices.ts new file mode 100644 index 00000000..7c242d57 --- /dev/null +++ b/src/services/ExploreServices.ts @@ -0,0 +1,31 @@ +import {ALL_USERS_ENDPOINT} from '../constants'; + +export const getAllTaggUsers = async ( + token: string, + setTaggUsers: Function, +) => { + try { + const response = await fetch(ALL_USERS_ENDPOINT, { + method: 'GET', + headers: { + Authorization: 'Token ' + token, + }, + }); + const status = response.status; + if (status === 200) { + const response_data = await response.json(); + setTaggUsers(response_data); + } else { + console.log( + 'Something went wrong! ðŸ˜', + 'Not able to retrieve tagg users list', + ); + } + } catch (error) { + console.log( + 'Something went wrong! ðŸ˜', + 'Not able to retrieve tagg users list', + error, + ); + } +}; |
