fix user create and delete handling (#4818)
This commit is contained in:
1 parent
04b4483d7d
commit
8ae095c3b8
2 files changed
+17
-4
No files matched your search
@@ -121,6 +121,17 @@ export function UsersMutateDrawer({
|
||||
const currentQuotaRaw = form.watch('quota_dollars') || 0
|
||||
|
||||
const onSubmit = async (data: UserFormValues) => {
|
||||
if (!isUpdate) {
|
||||
const passwordLength = data.password?.length || 0
|
||||
if (passwordLength < 8 || passwordLength > 20) {
|
||||
form.setError('password', {
|
||||
type: 'manual',
|
||||
message: t('Password must be between 8 and 20 characters'),
|
||||
})
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
setIsSubmitting(true)
|
||||
try {
|
||||
const payload = transformFormDataToPayload(data, currentRow?.id)
|
||||
|
||||
Reference in new issue
Block a user