aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile14
-rw-r--r--src/components/moments/Moment.tsx4
-rw-r--r--src/services/MomentService.ts8
3 files changed, 21 insertions, 5 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 00000000..b0022598
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,14 @@
+build:
+ yarn
+ cd ios && pod install && cd ..
+
+clean:
+ -rm *.lock
+ -rm ios/*.lock
+
+deep_clean:
+ -rm *.lock
+ -rm ios/*.lock
+ -rm -rf /Users/ivan/Library/Developer/Xcode/DerivedData
+ -rm -rf node_modules
+ yarn cache clean
diff --git a/src/components/moments/Moment.tsx b/src/components/moments/Moment.tsx
index d2f7be2e..34b2c7ea 100644
--- a/src/components/moments/Moment.tsx
+++ b/src/components/moments/Moment.tsx
@@ -1,4 +1,3 @@
-import AsyncStorage from '@react-native-community/async-storage';
import {useNavigation} from '@react-navigation/native';
import React from 'react';
import {Alert, StyleProp, StyleSheet, View, ViewStyle} from 'react-native';
@@ -75,8 +74,7 @@ const Moment: React.FC<MomentProps> = ({
if (fileName.endsWith('.heic') || fileName.endsWith('.HEIC')) {
fileName = fileName.split('.')[0] + '.jpg';
}
- const user = await AsyncStorage.getItem('username');
- let presignedURL = await handlePresignedURL(user || '', fileName);
+ let presignedURL = await handlePresignedURL(fileName, title);
console.log('presigned' + JSON.stringify(presignedURL));
handleVideoUpload(vid, presignedURL);
}
diff --git a/src/services/MomentService.ts b/src/services/MomentService.ts
index c7a88be3..d0ed56ab 100644
--- a/src/services/MomentService.ts
+++ b/src/services/MomentService.ts
@@ -224,15 +224,19 @@ export const deleteMomentTag = async (moment_tag_id: string) => {
* @returns a PresignedURLResponse object
*/
export const handlePresignedURL = async (
- value: string | undefined,
filename: string | undefined,
+ momentCategory: string,
) => {
try {
+ const token = await AsyncStorage.getItem('token');
const response = await fetch(PRESIGNED_URL_ENDPOINT, {
method: 'POST',
+ headers: {
+ Authorization: 'Token ' + token,
+ },
body: JSON.stringify({
- value,
filename,
+ category: momentCategory,
}),
});
const status = response.status;