()
| 496 | } |
| 497 | |
| 498 | async function create() { |
| 499 | if (!canCreate) { |
| 500 | setMessage("先搜索或定位选定一个真实地点。"); |
| 501 | return; |
| 502 | } |
| 503 | setBusy(true); |
| 504 | setMessage(""); |
| 505 | try { |
| 506 | const result = await api.createChallenge({ |
| 507 | name: name.trim(), |
| 508 | place_name: place.name, |
| 509 | center_lat: place.lat, |
| 510 | center_lng: place.lng, |
| 511 | radius_m: radius, |
| 512 | duration_hours: duration, |
| 513 | h3_resolution: resolution, |
| 514 | }); |
| 515 | onCreated(result.challenge); |
| 516 | } catch (err) { |
| 517 | setMessage(String(err)); |
| 518 | } finally { |
| 519 | setBusy(false); |
| 520 | } |
| 521 | } |
| 522 | |
| 523 | return ( |
| 524 | <section className="creatorLayout"> |
nothing calls this directly
no outgoing calls
no test coverage detected