From 92b924643eb7a4961b18d6d13bec0908cf44217a Mon Sep 17 00:00:00 2001 From: Trent Larson Date: Tue, 5 Mar 2024 20:20:54 -0700 Subject: [PATCH] fix camera resolution, parameterize image API server --- project.task.yaml | 3 +++ src/constants/app.ts | 5 +++++ src/views/GiftedPhoto.vue | 19 ++++++++----------- 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/project.task.yaml b/project.task.yaml index 489b84e9..4ed2a306 100644 --- a/project.task.yaml +++ b/project.task.yaml @@ -1,6 +1,9 @@ tasks : +- .1 on feed, don't show "to someone anonymous" if it's to a project +- .1 on ideas, put an "x" to close it + - .2 fix give dialog from "more contacts" off home page to allow giving to this user - 01 in the feed, group by project or contact or topic or time/$ (via BC) - .2 anchor hash into BTC diff --git a/src/constants/app.ts b/src/constants/app.ts index 4e94d01f..6c195192 100644 --- a/src/constants/app.ts +++ b/src/constants/app.ts @@ -12,10 +12,15 @@ export enum AppString { TEST1_PUSH_SERVER = "https://test.timesafari.app", TEST2_PUSH_SERVER = "https://timesafari-pwa.anomalistlabs.com", + PROD_IMAGE_API_SERVER = "https://image-api.timesafari.app", + TEST_IMAGE_API_SERVER = "https://test-image-api.timesafari.app", + LOCAL_IMAGE_API_SERVER = "http://localhost:3001", + NO_CONTACT_NAME = "(no name)", } export const DEFAULT_ENDORSER_API_SERVER = AppString.TEST_ENDORSER_API_SERVER; +export const DEFAULT_IMAGE_API_SERVER = AppString.LOCAL_IMAGE_API_SERVER; export const DEFAULT_PUSH_SERVER = window.location.protocol + "//" + window.location.host; diff --git a/src/views/GiftedPhoto.vue b/src/views/GiftedPhoto.vue index 6af183ba..c52fdac2 100644 --- a/src/views/GiftedPhoto.vue +++ b/src/views/GiftedPhoto.vue @@ -22,12 +22,11 @@ Dude, you got an image! Dude, you got an image!
- + --> +
@@ -39,6 +38,8 @@ import axios from "axios"; import Camera from "simple-vue-camera"; import { Component, Vue } from "vue-facing-decorator"; +import { DEFAULT_IMAGE_API_SERVER } from "@/constants/app"; + interface Notification { group: string; type: string; @@ -68,19 +69,15 @@ export default class GiftedPhoto extends Vue { return; } - //this.localImageUrl = URL.createObjectURL(blob); - - console.log("Got an image:", blob?.size); - const formData = new FormData(); formData.append("image", blob, "snapshot.jpg"); try { const response = await axios.post( - "http://localhost:3000/image", + DEFAULT_IMAGE_API_SERVER + "/image", formData, ); - console.log("Upload successful", response.data); + console.log("Sent. Response:", response.data); } catch (error) { console.error("Error uploading the image", error); }