Some icons changed, first implementation of contact edit

This commit is contained in:
Torsten Schulz
2024-08-21 23:05:11 +02:00
parent dfdb1660ff
commit c5a72d57d8
21 changed files with 134 additions and 5 deletions

View File

@@ -0,0 +1,64 @@
<template>
<div>
<h2>{{ $t('admin.contacts.title') }}</h2>
<table>
<thead>
<tr>
<th>{{ $t('admin.contacts.date') }}</th>
<th>{{ $t('admin.contacts.from') }}</th>
<th>{{ $t('admin.contacts.actions') }}</th>
</tr>
</thead>
<tbody>
<tr v-for="contact in contacts">
<td>{{ formatDateTimeLong(contact.createdAt) }}</td>
<td>{{ contact.email }}</td>
<td>
<button @clicked="openRequest(contact)">{{ $t('admin.contacts.open') }}</button>
<button @clicked="finishRequest(contact)">{{ $t('admin.contacts.finished') }}</button>
</td>
</tr>
</tbody>
</table>
</div>
<ErrorDialog ref="errorDialog" />
</template>
<script>
import apiClient from '@/utils/axios.js';
import { mapGetters } from 'vuex';
import ErrorDialog from '@/dialogues/standard/ErrorDialog.vue';
import { formatDateTimeLong } from '@/utils/datetime.js';
export default {
name: 'AdminContactsView',
components: {
ErrorDialog
},
data() {
return {
contacts: []
}
},
mounted() {
this.getContacts()
},
methods: {
formatDateTimeLong,
async getContacts() {
try {
const openContactRequests = await apiClient.get('/api/admin/opencontacts');
this.contacts = openContactRequests.data;
} catch (error) {
this.$refs.errorDialog.open(`tr:error.${error.response.data.error}`);
}
},
async openRequest(contact) {
},
async finishRequest(contact) {
}
}
}
</script>