Fixed format of events

This commit is contained in:
Torsten Schulz
2024-06-23 17:32:45 +02:00
parent 692e989861
commit 8b89d8b800
26 changed files with 455 additions and 157 deletions

View File

@@ -1,5 +1,5 @@
<template>
<span @click="downloadFile">{{ title }}</span>
<span v-if="title" @click="downloadFile">{{ title }}</span>
</template>
<script>
@@ -8,20 +8,33 @@ import axios from 'axios';
export default {
name: 'DownloadLink',
props: {
title: {
type: String,
required: true,
},
hash: {
type: String,
required: true,
},
extension: {
type: String,
required: true,
},
},
data() {
return {
title: '',
link: '',
};
},
async created() {
await this.fetchFile();
},
methods: {
async fetchFile() {
try {
console.log(this.hash);
const response = await axios.get('/files/hash/' + this.hash);
this.title = response.data.title;
console.log('Fetched files:', response.data.events);
this.events = response.data.events;
} catch (error) {
console.error('Fehler beim Abrufen der Events', error);
}
},
async downloadFile() {
const response = await axios.get(`/files/download/${this.hash}`, {
responseType: 'blob'