Some icons changed, first implementation of contact edit
This commit is contained in:
64
frontend/src/views/admin/ContactsView.vue
Normal file
64
frontend/src/views/admin/ContactsView.vue
Normal 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>
|
||||
Reference in New Issue
Block a user