diff --git a/src/app/(modules)/upload/page.tsx b/src/app/(modules)/upload/page.tsx index e54b8bc..ae0fc59 100644 --- a/src/app/(modules)/upload/page.tsx +++ b/src/app/(modules)/upload/page.tsx @@ -68,6 +68,11 @@ export default function UploadPage() { return; } + if (!jsonFile) { + setError('Please select a GPS JSON file'); + return; + } + if (!session) { setError('Please complete the project selection first'); return; @@ -77,10 +82,7 @@ export default function UploadPage() { formData.append('file', file); formData.append('detection_mode', selectMethod); formData.append('chainage_id', session.chainageId as string); - - if (jsonFile) { - formData.append('json_file', jsonFile); - } + formData.append('json_file', jsonFile); setUploading(true); setError(null); @@ -120,7 +122,7 @@ export default function UploadPage() { } const isSessionComplete = !!(session && sessionService.isSessionValid(session)); - const isFormValid = isSessionComplete && file; + const isFormValid = isSessionComplete && file && jsonFile; return (
@@ -162,7 +164,7 @@ export default function UploadPage() { 2. Upload Video Data - Provide the video file and optional GPS telemetry for processing. + Provide the video file and GPS telemetry for processing. @@ -191,7 +193,7 @@ export default function UploadPage() { {/* JSON File Input */}