diff options
author | guillaume-peoch-sonarsource <guillaume.peoch@sonarsource.com> | 2023-07-31 11:27:05 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2023-07-31 20:03:32 +0000 |
commit | 5a71bede94abbaea239c544130876c5f0e535815 (patch) | |
tree | 80f5c9e1c2d215066dd1ebabd676fbe55bd4083f /server/sonar-web/src/main/js/apps/users/components | |
parent | e7d3f62c1c161b76230960bc4301eaf7f20f7f1a (diff) | |
download | sonarqube-5a71bede94abbaea239c544130876c5f0e535815.tar.gz sonarqube-5a71bede94abbaea239c544130876c5f0e535815.zip |
SONAR-19967 Use POST api/v2/users on the FE
Diffstat (limited to 'server/sonar-web/src/main/js/apps/users/components')
-rw-r--r-- | server/sonar-web/src/main/js/apps/users/components/UserForm.tsx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/server/sonar-web/src/main/js/apps/users/components/UserForm.tsx b/server/sonar-web/src/main/js/apps/users/components/UserForm.tsx index b63ad7288ee..798ec561001 100644 --- a/server/sonar-web/src/main/js/apps/users/components/UserForm.tsx +++ b/server/sonar-web/src/main/js/apps/users/components/UserForm.tsx @@ -25,8 +25,8 @@ import MandatoryFieldMarker from '../../../components/ui/MandatoryFieldMarker'; import MandatoryFieldsExplanation from '../../../components/ui/MandatoryFieldsExplanation'; import { throwGlobalError } from '../../../helpers/error'; import { translate, translateWithParameters } from '../../../helpers/l10n'; -import { parseError } from '../../../helpers/request'; -import { useCreateUserMutation, useUpdateUserMutation } from '../../../queries/users'; +import { parseMessage } from '../../../helpers/request'; +import { usePostUserMutation, useUpdateUserMutation } from '../../../queries/users'; import { RestUserDetailed } from '../../../types/users'; import UserScmAccountInput from './UserScmAccountInput'; @@ -41,7 +41,7 @@ const INTERNAL_SERVER_ERROR = 500; export default function UserForm(props: Props) { const { user } = props; - const { mutate: createUser } = useCreateUserMutation(); + const { mutate: createUser } = usePostUserMutation(); const { mutate: updateUser } = useUpdateUserMutation(); const [email, setEmail] = React.useState<string>(user?.email ?? ''); @@ -55,7 +55,7 @@ export default function UserForm(props: Props) { if (![BAD_REQUEST, INTERNAL_SERVER_ERROR].includes(response.status)) { throwGlobalError(response); } else { - parseError(response).then((errorMsg) => setError(errorMsg), throwGlobalError); + parseMessage(response).then((errorMsg) => setError(errorMsg), throwGlobalError); } }; @@ -66,7 +66,7 @@ export default function UserForm(props: Props) { login, name, password, - scmAccount: scmAccounts, + scmAccounts, }, { onSuccess: props.onClose, onError: handleError } ); |