diff --git a/jams-react-client/src/globalUrls.js b/jams-react-client/src/globalUrls.js index a19492ff1aeaf2b0455f563ea78fc870e47e876d..85565dc03b6289195fa520f770d5ccc74a9b42b6 100644 --- a/jams-react-client/src/globalUrls.js +++ b/jams-react-client/src/globalUrls.js @@ -49,6 +49,7 @@ const api_path_delete_admin_contacts = "/api/admin/contacts"; const api_path_blueprints = "/api/admin/policy"; const api_path_get_user_profile = "/api/auth/userprofile/"; const api_path_get_ns_name_from_addr = "/api/nameserver/addr/"; +const api_path_get_ns_addr_from_name = "/api/nameserver/name/"; module.exports = { uri, @@ -100,4 +101,5 @@ module.exports = { api_path_blueprints, api_path_get_user_profile, api_path_get_ns_name_from_addr, + api_path_get_ns_addr_from_name, }; diff --git a/jams-react-client/src/views/UserProfile/EditCreateUserProfile.js b/jams-react-client/src/views/UserProfile/EditCreateUserProfile.js index 45879b46d5bb6c3af67f9b620869689461f183e9..2548051b2c4520f510c938345df4e23a95c576c0 100644 --- a/jams-react-client/src/views/UserProfile/EditCreateUserProfile.js +++ b/jams-react-client/src/views/UserProfile/EditCreateUserProfile.js @@ -61,7 +61,7 @@ import { api_path_post_create_user, api_path_post_create_user_profile, api_path_get_user_profile, - api_path_get_exists_user, + api_path_get_ns_addr_from_name, } from "../../globalUrls"; import dashboardStyle from "assets/jss/material-dashboard-react/views/dashboardStyle.js"; @@ -248,6 +248,7 @@ export default function EditCreateUserProfile(props) { }; const handleCreateUser = (data) => { + data.username = data.username.toLowerCase(); const body = { username: data.username, password: data.password, @@ -334,7 +335,14 @@ export default function EditCreateUserProfile(props) { const data = { username: value.toLowerCase(), }; - axios(configApiCall(api_path_get_exists_user, "GET", data, null)) + axios( + configApiCall( + api_path_get_ns_addr_from_name + data.username, + "GET", + null, + null + ) + ) .then((response) => { if (response.status === 200) { resolve(false);