diff options
Diffstat (limited to 'src/services')
| -rw-r--r-- | src/services/ExploreServices.ts | 31 | ||||
| -rw-r--r-- | src/services/index.ts | 1 |
2 files changed, 32 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, + ); + } +}; diff --git a/src/services/index.ts b/src/services/index.ts index 016511b3..bce3a75a 100644 --- a/src/services/index.ts +++ b/src/services/index.ts @@ -1,6 +1,7 @@ export * from './UserProfileService'; export * from './SocialLinkingService'; export * from './MomentServices'; +export * from './ExploreServices'; export * from './UserFollowServices'; export * from './ReportingService'; export * from './BlockUserService'; |
