mirror of
https://github.com/reiyua/github-profile-trophy-reiyua-mirror.git
synced 2026-11-17 06:02:09 +11:00
Support to parse list request params by csv
This commit is contained in:
parent
16c87caa4f
commit
1e2fb5bcba
1 changed files with 5 additions and 2 deletions
7
index.ts
7
index.ts
|
|
@ -11,8 +11,11 @@ export default async (req: ServerRequest) => {
|
||||||
const username = params.get("username");
|
const username = params.get("username");
|
||||||
let row = CONSTANTS.DEFAULT_MAX_ROW;
|
let row = CONSTANTS.DEFAULT_MAX_ROW;
|
||||||
let column = CONSTANTS.DEFAULT_MAX_COLUMN;
|
let column = CONSTANTS.DEFAULT_MAX_COLUMN;
|
||||||
let titles: Array<string> = params.getAll("title");
|
let titles: Array<string> = params.getAll("title").flatMap((r) =>
|
||||||
let ranks: Array<string> = params.getAll("rank");
|
r.split(",")
|
||||||
|
).map((r) => r.trim());
|
||||||
|
let ranks: Array<string> = params.getAll("rank").flatMap((r) => r.split(","))
|
||||||
|
.map((r) => r.trim());
|
||||||
if (params.has("row")) {
|
if (params.has("row")) {
|
||||||
const param = params.get("row");
|
const param = params.get("row");
|
||||||
if (param != null) {
|
if (param != null) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue