feat: add route constant
This commit is contained in:
@@ -13,6 +13,7 @@ import {
|
||||
} from "@/lib/api"
|
||||
import { getVideoFile } from "@/lib/video-storage"
|
||||
import { storeVideoFile } from "@/lib/video-storage"
|
||||
import { ROUTES } from "@/utils/routes"
|
||||
|
||||
const API_URL = process.env.NEXT_PUBLIC_API_URL
|
||||
const WS_URL = API_URL?.replace(/^https:\/\//, "wss://").replace(/^http:\/\//, "ws://")
|
||||
@@ -80,7 +81,7 @@ export default function VideoProcessingPage() {
|
||||
})
|
||||
|
||||
if (response.status === 404) {
|
||||
router.replace("/upload")
|
||||
router.replace(ROUTES.UPLOAD)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ import {
|
||||
saveVideoData,
|
||||
clearSession
|
||||
} from "@/lib/api"
|
||||
import { ROUTES } from "@/utils/routes"
|
||||
import { storeVideoFile } from "@/lib/video-storage"
|
||||
|
||||
const API_URL = process.env.NEXT_PUBLIC_API_URL
|
||||
@@ -63,7 +64,7 @@ export default function UploadPage() {
|
||||
useEffect(() => {
|
||||
const storedSession = loadSession()
|
||||
if (!isSessionValid(storedSession)) {
|
||||
router.replace("/new-analysis")
|
||||
router.replace(ROUTES.NEW_ANALYSIS)
|
||||
return
|
||||
}
|
||||
setSession(storedSession)
|
||||
@@ -136,7 +137,7 @@ export default function UploadPage() {
|
||||
|
||||
const handleBackToSelection = () => {
|
||||
clearSession()
|
||||
router.push("/new-analysis")
|
||||
router.push(ROUTES.NEW_ANALYSIS)
|
||||
}
|
||||
|
||||
const getTitle = () => {
|
||||
|
||||
Reference in New Issue
Block a user