fix version issue

This commit is contained in:
dylan 2024-03-31 20:04:28 -07:00
parent 79ec9f4eff
commit 6b422d649a

View File

@ -17,7 +17,7 @@ export const GamePage = () => {
const fetchInfo = async () => { const fetchInfo = async () => {
let url = `/api/release?author=${author}&slug=${slug}`; let url = `/api/release?author=${author}&slug=${slug}`;
if (version) { if (version) {
url += `version=${version}`; url += `&version=${version.slice(1)}`;
} }
const information = await fetch(url); const information = await fetch(url);
const json = await information.json(); const json = await information.json();
@ -66,7 +66,7 @@ export const GamePage = () => {
display: flex; display: flex;
justify-content: end; justify-content: end;
`}> `}>
Version: <select defaultValue={info.release.version} onChange={(ev) => navigate(`/api/release?author=${author}&slug=${slug}&version=${ev.target.value}`)}> Version: <select defaultValue={info.release.version} onChange={(ev) => navigate(`/u/${author}/${slug}/v${version}`)}>
{ {
info.versions.map(v => ( info.versions.map(v => (
<option key={v} value={v}>{v}</option> <option key={v} value={v}>{v}</option>