diff --git a/frontend/src/certs/Registers/index.tsx b/frontend/src/certs/Registers/index.tsx index 7ffe5d3..34e4fa7 100644 --- a/frontend/src/certs/Registers/index.tsx +++ b/frontend/src/certs/Registers/index.tsx @@ -147,14 +147,18 @@ function RegisterEl(props: {register: Register, person: Person, onClick: () => v const generator = certGenerator[courseN]; if (generator === undefined) { - console.error(`Generator function with key \`${courseN}\` not found`); + alert(`Generator function with key \`${courseN}\` not found`); return; } const {year, month, day} = dateComponents(); const personFullName = `${person.person_names} ${person.person_paternal_surname} ${person.person_maternal_surname}`; - const certCustomLabel = customLabelsMap()[register.register_custom_label]?.custom_label_value ?? ""; + // Manage custom label + const certCustomLabel = register.register_custom_label === 1 + ? "" + : customLabelsMap()[register.register_custom_label]?.custom_label_value ?? ""; + generator(`${courseN} - ${personFullName}.docx`, { matpel: null,