mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-30 10:29:42 +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:
@@ -117,9 +117,9 @@ export class ValidationException<
|
||||
* Check that the exception is a ValidationExceptionInterface
|
||||
* @param x
|
||||
*/
|
||||
export function isValidationException(
|
||||
export function isValidationException<M extends Record<string, Record<string, unknown>>>(
|
||||
x: unknown,
|
||||
): x is ValidationExceptionInterface<Record<string, Record<string, unknown>>> {
|
||||
): x is ValidationExceptionInterface<M> {
|
||||
return (
|
||||
x instanceof ValidationException ||
|
||||
(typeof x === "object" &&
|
||||
|
Reference in New Issue
Block a user