diff options
-rw-r--r-- | src/services/MomentService.ts | 29 |
1 files changed, 1 insertions, 28 deletions
diff --git a/src/services/MomentService.ts b/src/services/MomentService.ts index 514ca776..2354d18e 100644 --- a/src/services/MomentService.ts +++ b/src/services/MomentService.ts @@ -1,7 +1,7 @@ import AsyncStorage from '@react-native-community/async-storage'; import RNFetchBlob from 'rn-fetch-blob'; import {MOMENTS_ENDPOINT, MOMENT_THUMBNAIL_ENDPOINT} from '../constants'; -import {MomentType, MomentWithUserType} from '../types'; +import {MomentType} from '../types'; import {checkImageUploadStatus} from '../utils'; export const postMoment: ( @@ -78,33 +78,6 @@ export const loadMoments: ( return moments; }; -export const loadSingleMoment: ( - momentId: string, - token: string, -) => Promise<MomentWithUserType | undefined> = async (momentId, token) => { - let moment: MomentWithUserType; - try { - const response = await fetch(MOMENTS_ENDPOINT + `${momentId}/`, { - method: 'GET', - headers: { - Authorization: 'Token ' + token, - }, - }); - const status = response.status; - if (status === 200) { - const data = await response.json(); - moment = data; - } else { - console.log('Could not load moments!'); - return undefined; - } - } catch (err) { - console.log(err); - return undefined; - } - return moment; -}; - export const deleteMoment = async (momentId: string) => { try { const token = await AsyncStorage.getItem('token'); |