Enhance validation in PersonEdit: Introduce hasValidationError and validationError helpers for form inputs. Improve error feedback for fields such as firstName, lastName, gender, and others. Refactor postPerson to handle validation exceptions and map errors to specific fields. Update related methods, styles, and API error type definitions.

This commit is contained in:
2025-09-17 20:21:50 +02:00
parent 5ff374d2fa
commit c19206be0c
7 changed files with 355 additions and 183 deletions

View File

@@ -56,7 +56,7 @@ import {
ONTHEFLY_CREATE_THIRDPARTY,
trans,
} from "translator";
import {CreatableEntityType, Person} from "ChillPersonAssets/types";
import { CreatableEntityType, Person } from "ChillPersonAssets/types";
import { CreateComponentConfig } from "ChillMainAssets/types";
import PersonEdit from "ChillPersonAssets/vuejs/_components/OnTheFly/PersonEdit.vue";
@@ -66,9 +66,8 @@ const props = withDefaults(defineProps<CreateComponentConfig>(), {
query: "",
});
const emit = defineEmits<{
(e: "onPersonCreated", payload: { person: Person }): void;
}>();
const emit =
defineEmits<(e: "onPersonCreated", payload: { person: Person }) => void>();
const type = ref<CreatableEntityType | null>(null);
@@ -112,9 +111,7 @@ function save(): void {
castPerson.value.postPerson();
}
defineExpose({save});
defineExpose({ save });
</script>
<style lang="css" scoped>