⚠️ refactor (soapi): refactor form component to use usequerycrudmode and update api call

This commit is contained in:
Abizrh
2025-11-17 20:57:13 +07:00
parent 6ca03f562d
commit a8696284d7
5 changed files with 38 additions and 27 deletions
+2 -5
View File
@@ -11,7 +11,7 @@ import FunctionForm from './form-function.vue'
const route = useRoute()
const type = computed(() => (route.query.tab as string) || 'early-medical-assessment')
const { mode, openForm, backToList } = useQueryMode('mode')
const { mode, goToEntry, backToList } = useQueryCRUDMode('mode')
const formMap = {
'early-medical-assessment': EarlyForm,
@@ -24,10 +24,7 @@ const ActiveForm = computed(() => formMap[type.value] || EarlyForm)
<template>
<div>
<SoapiList
v-if="mode === 'list'"
@add="openForm"
/>
<SoapiList v-if="mode === 'list'" />
<component
v-else