From dc288d42bbc3c2fa864510b38d7282375618d9c6 Mon Sep 17 00:00:00 2001 From: Paul Valerie GOMA Date: Sun, 3 Aug 2025 04:28:31 +0200 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20=20refactor:=20useConfirmM?= =?UTF-8?q?odal=20composable=20updated?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/composable/useConfirmModal.ts | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/components/composable/useConfirmModal.ts b/src/components/composable/useConfirmModal.ts index 429b620..0bf333b 100644 --- a/src/components/composable/useConfirmModal.ts +++ b/src/components/composable/useConfirmModal.ts @@ -3,6 +3,8 @@ import { useConfirm } from "primevue"; import VButton from "../button/VButton.vue"; export function useConfirmModal() { + const confirm = useConfirm(); + const showConfirmModal = ({ acceptProps = VButton, rejectProps = VButton, @@ -10,17 +12,15 @@ export function useConfirmModal() { header = '', message = '', icon = '', - accept = () => {}, - reject = () => {}, - onHide = () => {}, - onShow = () => {}, + accept = Function, + reject = Function, + onHide = Function, + onShow = Function, modal = true, blockScroll = true, position = 'center', appendTo = 'body', }: ConfirmationOptions) => { - const confirm = useConfirm(); - confirm.require({ group, header, @@ -36,9 +36,7 @@ export function useConfirmModal() { blockScroll, position, appendTo, - }); - }; - - return { showConfirmModal }; + }) + } + return {showConfirmModal} } -