Ajitg25 commited on
Commit
23e74e3
Β·
verified Β·
1 Parent(s): 0a0b2e1

Fix: send difficulty in reset request body

Browse files
Files changed (1) hide show
  1. frontend/public/js/main.js +3 -1
frontend/public/js/main.js CHANGED
@@ -139,8 +139,10 @@ function animateMarker(marker, fromLL, toLL, durationMs) {
139
 
140
  // ── API ──────────────────────────────────────────────────────────────
141
  async function apiReset() {
 
142
  const res = await fetch(`${API}/reset`, {
143
- method: "POST", headers: {"Content-Type":"application/json"}, body: "{}",
 
144
  });
145
  return (await res.json()).observation;
146
  }
 
139
 
140
  // ── API ──────────────────────────────────────────────────────────────
141
  async function apiReset() {
142
+ const difficulty = document.getElementById("difficulty").value;
143
  const res = await fetch(`${API}/reset`, {
144
+ method: "POST", headers: {"Content-Type":"application/json"},
145
+ body: JSON.stringify({ difficulty }),
146
  });
147
  return (await res.json()).observation;
148
  }