web: submit page navigates to newly created submission
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Quaternions 2024-12-27 18:08:09 -08:00
parent f629ac2998
commit d584ee2c03

View File

@ -17,6 +17,9 @@ interface SubmissionPayload {
AssetVersion: number;
SubmissionType: number;
}
interface IdResponse {
ID: number;
}
export default function SubmissionInfoPage() {
const [game, setGame] = useState(1);
@ -49,9 +52,11 @@ export default function SubmissionInfoPage() {
});
// Allow any HTTP status
const responseText = await response.text();
const id_response:IdResponse = await response.json();
// navigate to newly created submission
window.location.assign(`/submissions/${id_response.ID}`)
console.log("Response Text:", responseText);
} catch (error) {
console.error("Error submitting data:", error);
}