Skip to content

Commit

Permalink
Remove casts
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles-Pham committed Dec 17, 2024
1 parent af36e9f commit 9010680
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 22 deletions.
20 changes: 12 additions & 8 deletions pages/decision-reviews.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -186,15 +186,19 @@ export async function getServerSideProps({
const logger = getLogger('decision-reviews')
logger.level = 'error'

const content = await getDecisionReviewsContent().catch((error) => {
logger.error(error)
return { err: '500' } as DecisionReviewContent
})
const content = await getDecisionReviewsContent().catch(
(error): DecisionReviewContent => {
logger.error(error)
return { err: '500' }
},
)

const authModals = await getAuthModalsContent().catch((error) => {
logger.error(error)
return { err: '500' } as AuthModalsContent
})
const authModals = await getAuthModalsContent().catch(
(error): AuthModalsContent => {
logger.error(error)
return { err: '500' }
},
)

/* istanbul ignore next */
const langToggleLink =
Expand Down
14 changes: 8 additions & 6 deletions pages/profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -177,15 +177,17 @@ export async function getServerSideProps({
const logger = getLogger('profile')
logger.level = 'error'

const content = await getProfileContent().catch((error) => {
const content = await getProfileContent().catch((error): ProfileContent => {
logger.error(error)
return { err: '500' } as ProfileContent
return { err: '500' }
})

const authModals = await getAuthModalsContent().catch((error) => {
logger.error(error)
return { err: '500' } as AuthModalsContent
})
const authModals = await getAuthModalsContent().catch(
(error): AuthModalsContent => {
logger.error(error)
return { err: '500' }
},
)

/* istanbul ignore next */
const langToggleLink = locale === 'en' ? '/fr/profil' : '/en/profile'
Expand Down
20 changes: 12 additions & 8 deletions pages/security-settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,15 +154,19 @@ export async function getServerSideProps({
const logger = getLogger('security-settings')
logger.level = 'error'

const content = await getSecuritySettingsContent().catch((error) => {
logger.error(error)
return { err: '500' } as SecuritySettingsContent
})
const content = await getSecuritySettingsContent().catch(
(error): SecuritySettingsContent => {
logger.error(error)
return { err: '500' }
},
)

const authModals = await getAuthModalsContent().catch((error) => {
logger.error(error)
return { err: '500' } as AuthModalsContent
})
const authModals = await getAuthModalsContent().catch(
(error): AuthModalsContent => {
logger.error(error)
return { err: '500' }
},
)

/* istanbul ignore next */
const langToggleLink =
Expand Down

0 comments on commit 9010680

Please sign in to comment.