mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-28 17:44:58 +00:00
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:
@@ -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>
|
||||
|
Reference in New Issue
Block a user