This commit is contained in:
@@ -531,16 +531,16 @@ export function card(app: App) {
|
|||||||
pair
|
pair
|
||||||
? {
|
? {
|
||||||
char: pair[0],
|
char: pair[0],
|
||||||
...pair[1]
|
...pair[1].sort(
|
||||||
.sort((a, b) => Number(a.order) - Number(b.order))
|
(a, b) => Number(a.order) - Number(b.order),
|
||||||
.shift(),
|
)[0],
|
||||||
}
|
}
|
||||||
: undefined)(Object.entries(e).shift()),
|
: undefined)(Object.entries(e)[0]),
|
||||||
);
|
);
|
||||||
if (!builds?.id) return status(404, errorLoc.buildNotFound);
|
if (!builds?.id) return status(404, errorLoc.buildNotFound);
|
||||||
|
|
||||||
const res = redirect(
|
const res = redirect(
|
||||||
`/v1/card/enka/${username}/${hoyo.hash}/${builds.char}/${builds.id}${new URLSearchParams(query as Record<string, string>)}`,
|
`/v1/card/enka/${username}/${hoyo.hash}/${builds.char}/${builds.id}?${new URLSearchParams(query as Record<string, string>)}`,
|
||||||
);
|
);
|
||||||
queueMicrotask(async () => {
|
queueMicrotask(async () => {
|
||||||
cache.set(cacheKey, res, 1000 * 60); // cache for 1 minute
|
cache.set(cacheKey, res, 1000 * 60); // cache for 1 minute
|
||||||
|
|||||||
Reference in New Issue
Block a user