Properly read suspect url from request

This commit is contained in:
Mia 2024-10-24 08:50:58 -05:00
parent 8241340f0e
commit 0f5a8f4200

View File

@ -1047,13 +1047,13 @@ export const actions: {[k: string]: QueryHandler} = {
throw new ActionError("Invalid reqs sent."); throw new ActionError("Invalid reqs sent.");
} }
// sim server should validate this already // sim server should validate this already
if (!reqs.url?.trim().length) { if (!params.url?.trim().length) {
throw new ActionError("Invalid suspect URL provided."); throw new ActionError("Invalid suspect URL provided.");
} }
const start = time(); const start = time();
try { try {
await smogonFetch("tools/api/suspect-create", "POST", { await smogonFetch("tools/api/suspect-create", "POST", {
url: reqs.url, url: params.url,
date: start + "", date: start + "",
reqs: JSON.stringify(reqs), reqs: JSON.stringify(reqs),
format: id, format: id,