<template>
    <div>
        <Table v-bind:table-data="tableData"/>
        <UploadFileButton/>
        <AddNewEntryButton/>
    </div>
</template>

<script>
    import Table from "./components/Table.vue";
    import UploadFileButton from "./components/UploadFileButton.vue";
    import AddNewEntryButton from './components/AddNewEntryButton.vue';
    import axios from 'axios';

    export default {
        name: "App",
        components: {Table, UploadFileButton, AddNewEntryButton},

        data() {
            return {
                tableData: []
            }
        },

        mounted() {
            axios
                .request({
                    url: '/api/get/',
                    method: 'post',
                    headers: {'Content-Type': 'application/json'},
                    data: JSON.stringify({'type': 'full'})
                })
                .then(response => {
                    this.tableData = response.data;
                })
        }
    }
</script>

<style scoped>

</style>