From 080e76350c2570eeb096fad40fe95f1b766b4539 Mon Sep 17 00:00:00 2001 From: Ivan Chen Date: Mon, 11 Jan 2021 16:11:11 -0500 Subject: created strings.ts and linting --- src/services/UserFriendsServices.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'src/services/UserFriendsServices.ts') diff --git a/src/services/UserFriendsServices.ts b/src/services/UserFriendsServices.ts index 0b138fc3..f7a39abf 100644 --- a/src/services/UserFriendsServices.ts +++ b/src/services/UserFriendsServices.ts @@ -2,6 +2,7 @@ import {Alert} from 'react-native'; import {FRIENDS_ENDPOINT} from '../constants'; +import {ERROR_SOMETHING_WENT_WRONG_REFRESH} from '../constants/strings'; export const loadFriends = async (userId: string, token: string) => { try { @@ -46,18 +47,12 @@ export const friendOrUnfriendUser = async ( return true; } else { console.log(await response.json()); - Alert.alert( - 'Something went wrong! 😭', - "Would you believe me if I told you that I don't know what happened?", - ); + Alert.alert(ERROR_SOMETHING_WENT_WRONG_REFRESH); return false; } } catch (error) { console.log(error); - Alert.alert( - 'Something went wrong! 😭', - "Would you believe me if I told you that I don't know what happened?", - ); + Alert.alert(ERROR_SOMETHING_WENT_WRONG_REFRESH); return false; } }; -- cgit v1.2.3-70-g09d2