aboutsummaryrefslogtreecommitdiff
path: root/src/utils/users.ts
diff options
context:
space:
mode:
authorIvan Chen <ivan@tagg.id>2021-06-07 17:53:27 -0400
committerGitHub <noreply@github.com>2021-06-07 17:53:27 -0400
commit5ef5b0776cbbde697919308bbfbab2aed00ca493 (patch)
tree0180365917b8483c660435381fb1e83393caee45 /src/utils/users.ts
parent63c5de57ea2989fd2b66211a06b51bb42c5d20ea (diff)
parentc18b2436897cd92e7a33c33c75e13dba1fec8ffe (diff)
Merge pull request #455 from IvanIFChen/tma878-profile-badges
[TMA-878] Profile Badges
Diffstat (limited to 'src/utils/users.ts')
-rw-r--r--src/utils/users.ts26
1 files changed, 3 insertions, 23 deletions
diff --git a/src/utils/users.ts b/src/utils/users.ts
index 8505cde2..64ad10e9 100644
--- a/src/utils/users.ts
+++ b/src/utils/users.ts
@@ -1,7 +1,8 @@
-import {Alert} from 'react-native';
import AsyncStorage from '@react-native-community/async-storage';
+import {Alert} from 'react-native';
+import ImagePicker from 'react-native-image-crop-picker';
import {INTEGRATED_SOCIAL_LIST} from '../constants';
-import {isUserBlocked, loadSocialPosts, removeBadgesService} from '../services';
+import {isUserBlocked, loadSocialPosts, patchEditProfile} from '../services';
import {
loadAllSocials,
loadBlockedList,
@@ -11,7 +12,6 @@ import {
loadUserMoments,
loadUserNotifications,
logout,
- updateUserBadges,
} from '../store/actions';
import {NO_SOCIAL_ACCOUNTS} from '../store/initialStates';
import {loadUserMomentCategories} from './../store/actions/momentCategories';
@@ -23,10 +23,7 @@ import {
ProfilePreviewType,
ScreenType,
UserType,
- UniversityBadge,
} from './../types/types';
-import ImagePicker from 'react-native-image-crop-picker';
-import {patchEditProfile} from '../services';
const loadData = async (dispatch: AppDispatch, user: UserType) => {
await Promise.all([
@@ -205,23 +202,6 @@ export const canViewProfile = (
return false;
};
-/* Function to call remove badge service,
- * remove selected badge from list passed in and
- * dispatch thunk action to update store
- */
-export const removeUserBadge = async (
- badges: UniversityBadge[],
- badgeName: string,
- userId: string,
- dispatch: AppDispatch,
-) => {
- const success = await removeBadgesService([badgeName], userId);
- if (success === true) {
- badges = badges.filter((badge) => badge.name !== badgeName);
- dispatch(updateUserBadges(badges));
- }
-};
-
export const navigateToProfile = async (
state: RootState,
dispatch: any,