From 04fc1030169451ddcb4533b07e6ba8decc29e69b Mon Sep 17 00:00:00 2001 From: mikolaj widla Date: Tue, 7 Mar 2023 11:02:47 +0100 Subject: [PATCH] Fixed validation for UUID --- .../src/main/resources/static/js/datatransfer.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Backend/mocked-services/src/main/resources/static/js/datatransfer.js b/Backend/mocked-services/src/main/resources/static/js/datatransfer.js index 12222d6..a8c6136 100644 --- a/Backend/mocked-services/src/main/resources/static/js/datatransfer.js +++ b/Backend/mocked-services/src/main/resources/static/js/datatransfer.js @@ -283,7 +283,8 @@ function checkUUIDChars(uuid) { uuid.replace(/ /g,'') console.log("UUID in check: " + uuid); const regex = new RegExp("^[A-z0-9-]+$"); - if(regex.test(uuid) || uuid == ""){ + console.log("UUID: "+uuid) + if(regex.test(uuid) && uuid != ""){ return uuid ; } return "invalid"; @@ -292,8 +293,8 @@ function checkUUIDChars(uuid) { function changeUUID(element){ const uuidStrategy = $('input[name="uuid-validation-type"]:checked').val(); - // const givenUUID = checkUUIDChars(element.value); - const givenUUID = element.value; + const givenUUID = checkUUIDChars(element.value); + //const givenUUID = element.value; console.log(givenUUID); if( givenUUID == clientUUID ){