fix(enka): correctly serialize search params
Build and Deploy / build-and-deploy (push) Successful in 1m5s

This commit is contained in:
2026-07-10 11:26:03 +07:00 Unverified
parent 65e28a203d
commit ebf0a73713
+1 -1
View File
@@ -540,7 +540,7 @@ export function card(app: App) {
if (!builds?.id) return status(404, errorLoc.buildNotFound);
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 () => {
cache.set(cacheKey, res, 1000 * 60); // cache for 1 minute