Fix translations and close button modal for duplicate evaluation document

This commit is contained in:
2025-09-11 14:21:05 +00:00
committed by Julien Fastré
parent c39637180a
commit db98519e65
4 changed files with 20 additions and 8 deletions

View File

@@ -30,11 +30,7 @@
>
<template #header>
<h3>
{{
trans(
ACPW_DUPLICATE_SELECT_ACCOMPANYING_PERIOD_WORK,
)
}}
{{ getModalTitle() }}
</h3>
</template>
@@ -73,6 +69,7 @@ import { AccompanyingPeriodWork } from "../../../types";
import {
trans,
ACPW_DUPLICATE_SELECT_ACCOMPANYING_PERIOD_WORK,
ACPW_DUPLICATE_SELECT_AN_EVALUATION,
CONFIRM,
} from "translator";
import { fetchResults } from "ChillMainAssets/lib/api/apiMethods";
@@ -97,6 +94,11 @@ const emit = defineEmits<{
"update:selectedEvaluation": [evaluation: AccompanyingPeriodWorkEvaluation];
}>();
const getModalTitle = () =>
evaluations.value.length > 0
? trans(ACPW_DUPLICATE_SELECT_AN_EVALUATION)
: trans(ACPW_DUPLICATE_SELECT_ACCOMPANYING_PERIOD_WORK);
onMounted(() => {
if (props.accompanyingPeriodId) {
getAccompanyingPeriodWorks(parseInt(props.accompanyingPeriodId));
@@ -106,6 +108,7 @@ onMounted(() => {
showModal.value = true;
});
const getAccompanyingPeriodWorks = async (periodId: number) => {
const url = `/api/1.0/person/accompanying-course/${periodId}/works.json`;