diff options
| author | Ivan Chen <ivan@tagg.id> | 2021-01-22 19:05:36 -0500 |
|---|---|---|
| committer | Ivan Chen <ivan@tagg.id> | 2021-01-22 19:05:36 -0500 |
| commit | e5915b02008dfcebe08de063f0440974c8415d4b (patch) | |
| tree | 308517c416605f13163bf6847e5c322ee23ab2e8 /src/services | |
| parent | cf420db54deb32be1e6bc4092eef105cc23d93e4 (diff) | |
| parent | 9921e80e60cb24d0fc7b99123a8b146c6e7d14ff (diff) | |
Merge branch 'master' into tma552-adjust-styles-and-sizes
# Conflicts:
# src/components/profile/Content.tsx
# src/screens/profile/MomentCommentsScreen.tsx
Diffstat (limited to 'src/services')
| -rw-r--r-- | src/services/MomentServices.ts | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/services/MomentServices.ts b/src/services/MomentServices.ts index 735f2ed2..7bad6d4c 100644 --- a/src/services/MomentServices.ts +++ b/src/services/MomentServices.ts @@ -14,9 +14,9 @@ import {checkImageUploadStatus} from '../utils'; export const getMomentComments = async ( momentId: string, callback: Function, - token: string, ) => { try { + const token = await AsyncStorage.getItem('token'); const response = await fetch(COMMENTS_ENDPOINT + '?moment_id=' + momentId, { method: 'GET', headers: { @@ -35,14 +35,13 @@ export const getMomentComments = async ( } }; -//Post a comment on a moment export const postMomentComment = async ( commenter: string, comment: string, momentId: string, - token: string, ) => { try { + const token = await AsyncStorage.getItem('token'); const request = new FormData(); request.append('moment_id', momentId); request.append('commenter', commenter); @@ -60,7 +59,7 @@ export const postMomentComment = async ( return await response.json(); } catch (error) { Alert.alert(ERROR_FAILED_TO_COMMENT); - return {}; + return undefined; } }; |
