Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Unverified
Commit
8ae095c3
authored
May 19, 2026
by
Baiyuan Chiu
Committed by
GitHub
May 19, 2026
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix user create and delete handling (#4818)
parent
04b4483d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
4 deletions
+17
-4
controller/user.go
+6
-4
web/default/src/features/users/components/users-mutate-drawer.tsx
+11
-0
No files found.
controller/user.go
View file @
8ae095c3
...
@@ -782,12 +782,14 @@ func DeleteUser(c *gin.Context) {
...
@@ -782,12 +782,14 @@ func DeleteUser(c *gin.Context) {
}
}
err
=
model
.
HardDeleteUserById
(
id
)
err
=
model
.
HardDeleteUserById
(
id
)
if
err
!=
nil
{
if
err
!=
nil
{
c
.
JSON
(
http
.
StatusOK
,
gin
.
H
{
common
.
ApiError
(
c
,
err
)
"success"
:
true
,
"message"
:
""
,
})
return
return
}
}
c
.
JSON
(
http
.
StatusOK
,
gin
.
H
{
"success"
:
true
,
"message"
:
""
,
})
return
}
}
func
DeleteSelf
(
c
*
gin
.
Context
)
{
func
DeleteSelf
(
c
*
gin
.
Context
)
{
...
...
web/default/src/features/users/components/users-mutate-drawer.tsx
View file @
8ae095c3
...
@@ -121,6 +121,17 @@ export function UsersMutateDrawer({
...
@@ -121,6 +121,17 @@ export function UsersMutateDrawer({
const
currentQuotaRaw
=
form
.
watch
(
'quota_dollars'
)
||
0
const
currentQuotaRaw
=
form
.
watch
(
'quota_dollars'
)
||
0
const
onSubmit
=
async
(
data
:
UserFormValues
)
=>
{
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
)
setIsSubmitting
(
true
)
try
{
try
{
const
payload
=
transformFormDataToPayload
(
data
,
currentRow
?.
id
)
const
payload
=
transformFormDataToPayload
(
data
,
currentRow
?.
id
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment