mirror of
https://github.com/faiztyanirh/clqms-shadcn-v1.git
synced 2026-04-22 09:35:34 +07:00
fix errors editpage
This commit is contained in:
parent
8fc4f0ee79
commit
cc22abb033
@ -67,6 +67,10 @@ function enterCreate(initialData = null) {
|
||||
|
||||
formState.reset();
|
||||
Object.assign(formState.form, data);
|
||||
|
||||
Object.keys(formState.errors).forEach(key => {
|
||||
formState.errors[key] = null;
|
||||
});
|
||||
}
|
||||
|
||||
function exitForm() {
|
||||
|
||||
@ -7,9 +7,10 @@
|
||||
import { API } from "$lib/config/api";
|
||||
|
||||
let props = $props();
|
||||
const { masterDetail, formFields, formActions, schema } = props.context;
|
||||
const { masterDetail, formFields, formActions, schema, initialForm } = props.context;
|
||||
|
||||
const { formState } = masterDetail;
|
||||
|
||||
console.log(formState);
|
||||
|
||||
const helpers = usePatientForm(formState, schema);
|
||||
@ -22,9 +23,9 @@
|
||||
const formData = {
|
||||
...backendData,
|
||||
|
||||
PatIdt: backendData.PatIdt ?? formState.form.PatIdt,
|
||||
PatIdt: backendData.PatIdt ?? initialForm.PatIdt,
|
||||
LinkTo: backendData.LinkTo ?? [],
|
||||
Custodian: backendData.Custodian ?? formState.form.Custodian,
|
||||
Custodian: backendData.Custodian ?? initialForm.Custodian,
|
||||
|
||||
Sex: backendData.SexKey || backendData.Sex,
|
||||
Religion: backendData.ReligionKey || backendData.Religion,
|
||||
|
||||
@ -28,6 +28,11 @@
|
||||
formFields: patientFormFields,
|
||||
formActions: getPatientFormActions,
|
||||
schema: patientSchema,
|
||||
initialForm: patientInitialForm,
|
||||
defaultErrors: {
|
||||
create: patientDefaultErrors,
|
||||
edit: {}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user