From 5c6bedb572556586d34b99384dac1cad3a153402 Mon Sep 17 00:00:00 2001
From: Ivan Chen <ivan@tagg.id>
Date: Tue, 1 Jun 2021 16:41:18 -0400
Subject: Refactor to use action instead of util function

---
 src/components/common/BadgeDetailView.tsx | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

(limited to 'src/components/common/BadgeDetailView.tsx')

diff --git a/src/components/common/BadgeDetailView.tsx b/src/components/common/BadgeDetailView.tsx
index 6504300c..ee66aa15 100644
--- a/src/components/common/BadgeDetailView.tsx
+++ b/src/components/common/BadgeDetailView.tsx
@@ -7,9 +7,10 @@ import {useDispatch, useSelector} from 'react-redux';
 import CloseIcon from '../../assets/ionicons/close-outline.svg';
 import {BADGE_GRADIENT_FIRST} from '../../constants';
 import {BADGE_DATA} from '../../constants/badges';
+import {removeUserBadge} from '../../store/actions';
 import {RootState} from '../../store/rootreducer';
 import {ScreenType} from '../../types';
-import {getUniversityBadge, normalize, removeUserBadge} from '../../utils';
+import {getUniversityBadge, normalize} from '../../utils';
 
 interface BadgeDetailModalProps {
   userXId: string | undefined;
@@ -59,7 +60,7 @@ const BadgeDetailView: React.FC<BadgeDetailModalProps> = ({
   }, [badges]);
 
   const removeBadgeCell = async (badgeName: string) => {
-    await removeUserBadge(badges, badgeName, user.userId, dispatch);
+    dispatch(removeUserBadge(badgeName, user.userId));
   };
 
   const badgeEditCell = ({item: {id, name, badgeImage}}) => {
-- 
cgit v1.2.3-70-g09d2

