diff --git a/frontend/src/routes/company/+page.svelte b/frontend/src/routes/company/+page.svelte index 49cc56d..37a4b83 100644 --- a/frontend/src/routes/company/+page.svelte +++ b/frontend/src/routes/company/+page.svelte @@ -5,11 +5,8 @@ import Headline from '$lib/components/Headline.svelte'; import TableRow from '$lib/components/table/TableRow.svelte'; import TableCell from '$lib/components/table/TableCell.svelte'; - import TableDeleteButton from '$lib/components/table/TableDeleteButton2.svelte'; import FormError from '$lib/components/FormError.svelte'; import { addToast } from '$lib/store/toast'; - import TableCellAction from '$lib/components/table/TableCellAction.svelte'; - import TableCellEmpty from '$lib/components/table/TableCellEmpty.svelte'; import { newTableURLParams } from '$lib/service/tableURLParams.js'; import Modal from '$lib/components/Modal.svelte'; import BigButton from '$lib/components/BigButton.svelte'; @@ -17,8 +14,6 @@ import Table from '$lib/components/table/Table.svelte'; import HeadTitle from '$lib/components/HeadTitle.svelte'; import { showIsLoading, hideIsLoading } from '$lib/store/loading.js'; - import TableDropDownEllipsis from '$lib/components/table/TableDropDownEllipsis.svelte'; - import DeleteAlert from '$lib/components/modal/DeleteAlert.svelte'; import Alert from '$lib/components/Alert.svelte'; // bindings @@ -36,12 +31,6 @@ let isSubmitting = false; let isTableLoading = true; - let isDeleteAlertVisible = false; - let deleteValues = { - id: null, - name: null - }; - let isExportSharedModalVisible = false; // hooks @@ -108,31 +97,6 @@ refreshCompanies(); }; - const openDeleteAlert = async (company) => { - isDeleteAlertVisible = true; - deleteValues.id = company.id; - deleteValues.name = company.name; - }; - - /** - * Deletes a company - * @param {number} id - */ - const onClickDelete = async (id) => { - const action = api.company.delete(id); - action - .then((res) => { - if (!res.success) { - throw res.error; - } - refreshCompanies(); - }) - .catch((e) => { - console.error('failed to delete company:', e); - }); - return action; - }; - const openCreateModal = () => { modalError = ''; formValues.name = null; @@ -180,6 +144,7 @@ hasNextPage={companiesHasNextPage} plural="companies" pagination={tableURLParams} + hasActions={false} isGhost={isTableLoading} > {#each companies as company} @@ -192,12 +157,6 @@ {company.name} - - - - openDeleteAlert(company)} /> - - {/each} @@ -258,13 +217,6 @@ - onClickDelete(deleteValues.id)} - bind:isVisible={isDeleteAlertVisible} - > -