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
Commit
6b9e80e9
authored
Dec 11, 2024
by
CalciumIon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: Enhance EditRedemption component with default name handling
parent
b381d994
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
web/src/pages/Redemption/EditRedemption.js
+7
-2
No files found.
web/src/pages/Redemption/EditRedemption.js
View file @
6b9e80e9
...
@@ -7,7 +7,7 @@ import {
...
@@ -7,7 +7,7 @@ import {
showError
,
showError
,
showSuccess
,
showSuccess
,
}
from
'../../helpers'
;
}
from
'../../helpers'
;
import
{
renderQuotaWithPrompt
}
from
'../../helpers/render'
;
import
{
getQuotaPerUnit
,
renderQuota
,
renderQuotaWithPrompt
}
from
'../../helpers/render'
;
import
{
import
{
AutoComplete
,
AutoComplete
,
Button
,
Button
,
...
@@ -66,11 +66,16 @@ const EditRedemption = (props) => {
...
@@ -66,11 +66,16 @@ const EditRedemption = (props) => {
},
[
props
.
editingRedemption
.
id
]);
},
[
props
.
editingRedemption
.
id
]);
const
submit
=
async
()
=>
{
const
submit
=
async
()
=>
{
if
(
!
isEdit
&&
inputs
.
name
===
''
)
return
;
let
name
=
inputs
.
name
;
if
(
!
isEdit
&&
inputs
.
name
===
''
)
{
// set default name
name
=
'兑换码-'
+
renderQuota
(
quota
);
}
setLoading
(
true
);
setLoading
(
true
);
let
localInputs
=
inputs
;
let
localInputs
=
inputs
;
localInputs
.
count
=
parseInt
(
localInputs
.
count
);
localInputs
.
count
=
parseInt
(
localInputs
.
count
);
localInputs
.
quota
=
parseInt
(
localInputs
.
quota
);
localInputs
.
quota
=
parseInt
(
localInputs
.
quota
);
localInputs
.
name
=
name
;
let
res
;
let
res
;
if
(
isEdit
)
{
if
(
isEdit
)
{
res
=
await
API
.
put
(
`/api/redemption/`
,
{
res
=
await
API
.
put
(
`/api/redemption/`
,
{
...
...
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