fix(enka): correctly serialize search params
Build and Deploy / build-and-deploy (push) Successful in 1m5s
Build and Deploy / build-and-deploy (push) Successful in 1m5s
This commit is contained in:
@@ -540,7 +540,7 @@ export function card(app: App) {
|
|||||||
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(Object.fromEntries(Object.entries(query).map(([k, v]) => [k, v === undefined ? v : String(v)])))}`,
|
||||||
);
|
);
|
||||||
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