Skip to content

Commit

Permalink
Merge pull request #572 from intuitem/fix/delete_evidence_attachment
Browse files Browse the repository at this point in the history
Fix non-working delete evidence attachment button
  • Loading branch information
Mohamed-Hacene authored Jun 24, 2024
2 parents 230d938 + e9bbc7a commit 6b2e10a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ export const load: PageServerLoad = async ({ fetch, params }) => {
}
}

return { URLModel, evidence, object, tables };
const schema = z.object({ id: z.string().uuid() });
const deleteForm = await superValidate(zod(schema));

return { URLModel, evidence, object, tables, deleteForm };
};

export const actions: Actions = {
Expand Down
11 changes: 2 additions & 9 deletions frontend/src/routes/(app)/evidences/[id=uuid]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,7 @@
import { breadcrumbObject } from '$lib/utils/stores';
import { URL_MODEL_MAP } from '$lib/utils/crud';
import ConfirmModal from '$lib/components/Modals/ConfirmModal.svelte';
import type {
ModalSettings,
ModalComponent,
ModalStore,
ToastStore
} from '@skeletonlabs/skeleton';
import type { ModalSettings, ModalComponent, ModalStore } from '@skeletonlabs/skeleton';
import { getModalStore, TabGroup, Tab, getToastStore } from '@skeletonlabs/skeleton';
import { isURL } from '$lib/utils/helpers';
import { getModelInfo } from '$lib/utils/crud.js';
Expand All @@ -29,15 +24,13 @@
}
let attachment: Attachment | undefined = undefined;
const modalStore: ModalStore = getModalStore();
const toastStore: ToastStore = getToastStore();
function modalConfirm(id: string, name: string, action: string): void {
const modalComponent: ModalComponent = {
ref: ConfirmModal,
props: {
_form: data.evidence.form,
_form: data.deleteForm,
id: id,
debug: false,
URLModel: getModelInfo('evidences').urlModel,
Expand Down

0 comments on commit 6b2e10a

Please sign in to comment.