feat(patient): add patient handler and refactor form submission

- Introduce new patient handler using genCrudHandler for CRUD operations
- Refactor patient entry form to use handler for save operations
- Separate form data composition from submission logic
- Handle file uploads and navigation after successful submission
This commit is contained in:
Khafid Prayoga
2025-10-16 14:04:00 +07:00
parent 20b96ab7e4
commit 070239270e
3 changed files with 100 additions and 44 deletions

No files matched your search

+24
View File
@@ -0,0 +1,24 @@
// Handlers
import { genCrudHandler } from '~/handlers/_handler'
// Services
import { postPatient as create, patchPatient as update, removePatient as remove } from '~/services/patient.service'
export const {
recId,
recAction,
recItem,
isReadonly,
isProcessing,
isFormEntryDialogOpen,
isRecordConfirmationOpen,
onResetState,
handleActionSave,
handleActionEdit,
handleActionRemove,
handleCancelForm,
} = genCrudHandler({
create,
update,
remove,
})