From 608c82870bc27a67da3a1b261c4fc5b4116215ce Mon Sep 17 00:00:00 2001 From: Fredrik Strand Oseberg Date: Thu, 10 Feb 2022 14:33:12 +0100 Subject: [PATCH] Fix/create feature validation (#692) * fix: display error if bad request * 4.7.2 * fix: resolve conflict --- frontend/package.json | 2 +- frontend/src/component/feature/hooks/useFeatureForm.ts | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/frontend/package.json b/frontend/package.json index 88a7544a8c..3d5a96248e 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,7 +1,7 @@ { "name": "unleash-frontend", "description": "unleash your features", - "version": "4.7.1", + "version": "4.7.2", "keywords": [ "unleash", "feature toggle", diff --git a/frontend/src/component/feature/hooks/useFeatureForm.ts b/frontend/src/component/feature/hooks/useFeatureForm.ts index 7389e8bb70..fabb56e505 100644 --- a/frontend/src/component/feature/hooks/useFeatureForm.ts +++ b/frontend/src/component/feature/hooks/useFeatureForm.ts @@ -71,6 +71,11 @@ const useFeatureForm = ( ...prev, name: 'A feature with this name already exists', })); + } else { + setErrors(prev => ({ + ...prev, + name: e.toString(), + })); } return false; }