aboutsummaryrefslogtreecommitdiff
path: root/src/services
diff options
context:
space:
mode:
authorShravya Ramesh <37447613+shravyaramesh@users.noreply.github.com>2020-11-20 13:20:49 -0800
committerGitHub <noreply@github.com>2020-11-20 16:20:49 -0500
commit3214fc765cbce3c6f9092546424249d08622afb1 (patch)
tree862aa8872d670195f2a33264f672782ea1077c9c /src/services
parent713d169915a82edfcfe4b44622e3dce8c6adaf0c (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')
-rw-r--r--src/services/ExploreServices.ts31
-rw-r--r--src/services/index.ts1
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';