aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Chen <ivan@tagg.id>2021-07-29 14:11:28 -0400
committerGitHub <noreply@github.com>2021-07-29 14:11:28 -0400
commit64c0bcbf9b59c42f615000e1c1cfa7e126a4edde (patch)
tree05e1584aafdf550ba13b93760d8ae18cad757237
parent265814c782e4196bf57cd2fb507f80546498618e (diff)
parent4170b75030ff07339a5d59a32206dc6e2d843ed7 (diff)
Merge pull request #532 from IvanIFChen/hotfix-moment-caption
[HOTFIX] Video Moments to Accept Caption
-rw-r--r--src/screens/profile/CaptionScreen.tsx1
-rw-r--r--src/services/MomentService.ts6
-rw-r--r--src/store/actions/user.ts6
3 files changed, 11 insertions, 2 deletions
diff --git a/src/screens/profile/CaptionScreen.tsx b/src/screens/profile/CaptionScreen.tsx
index 66106a6f..d329c589 100644
--- a/src/screens/profile/CaptionScreen.tsx
+++ b/src/screens/profile/CaptionScreen.tsx
@@ -166,6 +166,7 @@ const CaptionScreen: React.FC<CaptionScreenProps> = ({route, navigation}) => {
handleVideoMomentUpload(
mediaUri,
videoDuration ?? 30,
+ caption,
momentCategory,
formattedTags(),
),
diff --git a/src/services/MomentService.ts b/src/services/MomentService.ts
index 3a677ccc..0292f9ea 100644
--- a/src/services/MomentService.ts
+++ b/src/services/MomentService.ts
@@ -223,7 +223,10 @@ export const deleteMomentTag = async (moment_tag_id: string) => {
* @param value: string | undefined
* @returns a PresignedURLResponse object
*/
-export const handlePresignedURL = async (momentCategory: string) => {
+export const handlePresignedURL = async (
+ caption: string,
+ momentCategory: string,
+) => {
try {
// TODO: just a random filename for video poc, we should not need to once complete
const randHash = Math.random().toString(36).substring(7);
@@ -236,6 +239,7 @@ export const handlePresignedURL = async (momentCategory: string) => {
},
body: JSON.stringify({
filename,
+ caption: caption,
category: momentCategory,
}),
});
diff --git a/src/store/actions/user.ts b/src/store/actions/user.ts
index 14865f25..f01e2bac 100644
--- a/src/store/actions/user.ts
+++ b/src/store/actions/user.ts
@@ -380,6 +380,7 @@ export const handleVideoMomentUpload =
(
videoUri: string,
videoLength: number,
+ caption: string,
momentCategory: string,
formattedTags: {
x: number;
@@ -413,7 +414,10 @@ export const handleVideoMomentUpload =
payload: {momentUploadProgressBar},
});
// get a presigned url for the video
- const presignedURLResponse = await handlePresignedURL(momentCategory);
+ const presignedURLResponse = await handlePresignedURL(
+ caption,
+ momentCategory,
+ );
if (!presignedURLResponse) {
handleError('Presigned URL failed');
return;