Skip to content

Commit

Permalink
fix(exams): add confirmation dialog when accepting or rejecting a pro…
Browse files Browse the repository at this point in the history
…visional grade
  • Loading branch information
lpezzolla authored and Bri74 committed Feb 6, 2024
1 parent 4501998 commit 243d75f
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions src/features/transcript/screens/ProvisionalGradeScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,13 @@ export const ProvisionalGradeScreen = ({ navigation, route }: Props) => {
<CtaButton
title={t('provisionalGradeScreen.acceptGradeCta')}
action={() =>
confirmAcceptance().then(() =>
acceptGradeQuery
.mutateAsync(grade.id)
.then(() => provideFeedback(true)),
)
confirmAcceptance().then(ok => {
if (ok) {
acceptGradeQuery
.mutateAsync(grade.id)
.then(() => provideFeedback(true));
}
})
}
variant="outlined"
absolute={false}
Expand All @@ -149,11 +151,13 @@ export const ProvisionalGradeScreen = ({ navigation, route }: Props) => {
<CtaButton
title={t('provisionalGradeScreen.rejectGradeCta')}
action={() =>
confirmRejection().then(() =>
rejectGradeQuery
.mutateAsync(grade.id)
.then(() => provideFeedback(false)),
)
confirmRejection().then(ok => {
if (ok) {
rejectGradeQuery
.mutateAsync(grade.id)
.then(() => provideFeedback(false));
}
})
}
absolute={false}
loading={rejectGradeQuery.isLoading}
Expand Down

0 comments on commit 243d75f

Please sign in to comment.