From 40a4b9eda7fd6ca7e1d557aae970185fe283b1d8 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Sun, 14 Apr 2024 17:50:30 +0200 Subject: [PATCH] Refactoring --- apps/client/src/app/util/form.util.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/client/src/app/util/form.util.ts b/apps/client/src/app/util/form.util.ts index 4a42e8829..f2dd4f1b8 100644 --- a/apps/client/src/app/util/form.util.ts +++ b/apps/client/src/app/util/form.util.ts @@ -18,12 +18,12 @@ export async function validateObjectForForm({ return Promise.resolve(); } - for (const error of errors) { - const formControl = form.get(error.property); + for (const { constraints, property } of errors) { + const formControl = form.get(property); if (formControl) { formControl.setErrors({ - validationError: Object.values(error.constraints)[0] + validationError: Object.values(constraints)[0] }); } }