Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { Dispatch, FC, SetStateAction, useCallback, useContext, useEffect, useState } from 'react'
import { Params, useNavigate, useParams } from 'react-router-dom'
import { AxiosError } from 'axios'

import { profileContext, ProfileContextData, profileGetPublicAsync, UserProfile } from '~/libs/core'
import { TALENT_SEARCH_PATHS } from '~/apps/talent-search'
import { LoadingSpinner } from '~/libs/ui'

import { notifyUniNavi, triggerSprigSurvey } from '../lib'
Expand Down Expand Up @@ -34,7 +36,11 @@ const MemberProfilePage: FC<{}> = () => {
setProfile({ ...userProfile } as UserProfile)
setProfileReady(true)
})
// TODO: NOT FOUND PAGE redirect/dispaly
.catch((e: AxiosError) => {
if (e.code === AxiosError.ERR_BAD_REQUEST && e.response?.status === 404) {
window.location.href = `${TALENT_SEARCH_PATHS.absoluteRootUrl}?memberNotFound`
}
})
}
}, [routeParams.memberHandle])

Expand Down
2 changes: 1 addition & 1 deletion src/apps/talent-search/src/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { talentSearchRoutes } from './talent-search.routes'
export { talentSearchRoutes, TALENT_SEARCH_PATHS } from './talent-search.routes'
9 changes: 8 additions & 1 deletion src/apps/talent-search/src/talent-search.routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,18 @@ const TalentPage: LazyLoadedComponent = lazyLoad(
'TalentPage',
)

const isOnAppSubdomain = EnvironmentConfig.SUBDOMAIN === AppSubdomain.talentSearch
export const rootRoute: string = (
EnvironmentConfig.SUBDOMAIN === AppSubdomain.talentSearch ? '' : `/${AppSubdomain.talentSearch}`
isOnAppSubdomain ? '' : `/${AppSubdomain.talentSearch}`
)

const absoluteRootUrl = (() => {
const subdomain = isOnAppSubdomain ? AppSubdomain.talentSearch : EnvironmentConfig.SUBDOMAIN
return `//${subdomain}.${EnvironmentConfig.TC_DOMAIN}${rootRoute}`
})()

export const TALENT_SEARCH_PATHS = {
absoluteRootUrl,
results: `${rootRoute}/results`,
root: rootRoute,
talent: `${rootRoute}/talent`,
Expand Down