Skip to content

Commit

Permalink
Updated thumbnail function
Browse files Browse the repository at this point in the history
  • Loading branch information
asriniv4 committed Jan 23, 2023
1 parent bbe13be commit c718fb7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
15 changes: 10 additions & 5 deletions netlify/functions/get-thumbnail.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,19 @@ const supabase = createClient(CSATS_DATABASE_URL, CSATS_DATABASE_SECRET_API_KEY)
exports.handler = async function (event, context) {
const thumbnameName = event.queryStringParameters

// let { data, error } = await supabase
// .storage
// .from('case-thumbnails')
// .download(event)
let { data, error } = await supabase
.storage
.from('case-thumbnails')
.download(thumbnameName);

console.log(data, error);

return {
statusCode: 200,
body: JSON.stringify({ message: 'hello'}),
headers: {
"Access-Control-Allow-Origin": "*", // TODO: Tighten security here
},
body: data,
};

}
12 changes: 7 additions & 5 deletions src/components/CaseCard.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<script setup>
import { ref, onMounted } from 'vue';
import { defineProps, ref, onMounted, toRefs } from 'vue';
import axios from 'axios';
defineProps({
const props = defineProps({
myCase: {
type: Object,
required: true,
Expand All @@ -11,10 +11,12 @@ defineProps({
const thumbnail_image = ref(null);
const { myCase } = toRefs(props);
const GET_THUMBNAIL_URL = `https://aurora.ismorebetter.com/.netlify/function/get-thumbnail?name=${myCase.value.thumbnail_location}`;
onMounted(() => {
console.log(this);
const GET_THUMBNAIL_URL = 'https://google.com/'
//https://aurora.ismorebetter.com/.netlify/function/get-thumbnail?name=${myCase.thumbnail_location};
console.log('hellow!!!!!');
console.log(GET_THUMBNAIL_URL);
axios.get(GET_THUMBNAIL_URL)
.then((response) => {
thumbnail_image.value = response.data;
Expand Down

0 comments on commit c718fb7

Please sign in to comment.