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
efee4097
authored
Nov 10, 2023
by
CaIon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复兑换码bug
parent
f453dc0a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletions
+11
-1
web/package.json
+1
-1
web/src/components/RedemptionsTable.js
+10
-0
No files found.
web/package.json
View file @
efee4097
...
...
@@ -49,5 +49,5 @@
"singleQuote"
:
true
,
"jsxSingleQuote"
:
true
},
"proxy"
:
"http
s://nekoapi.com
"
"proxy"
:
"http
://localhost:3000
"
}
web/src/components/RedemptionsTable.js
View file @
efee4097
...
...
@@ -166,16 +166,26 @@ const RedemptionsTable = () => {
setShowEdit
(
false
);
}
const
setCount
=
(
data
)
=>
{
if
(
data
.
length
>=
(
activePage
)
*
ITEMS_PER_PAGE
)
{
setTokenCount
(
data
.
length
+
1
);
}
else
{
setTokenCount
(
data
.
length
);
}
}
const
loadRedemptions
=
async
(
startIdx
)
=>
{
const
res
=
await
API
.
get
(
`/api/redemption/?p=
${
startIdx
}
`
);
const
{
success
,
message
,
data
}
=
res
.
data
;
if
(
success
)
{
if
(
startIdx
===
0
)
{
setRedemptions
(
data
);
setCount
(
data
);
}
else
{
let
newRedemptions
=
redemptions
;
newRedemptions
.
push
(...
data
);
setRedemptions
(
newRedemptions
);
setCount
(
newRedemptions
);
}
}
else
{
showError
(
message
);
...
...
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