Skip to content

Commit

Permalink
fix(admin): add missing blockText when defaultValue exists in Compete…
Browse files Browse the repository at this point in the history
…nciesBlockPage
  • Loading branch information
ThomasDos committed Nov 29, 2024
1 parent 22e446c commit fffdc64
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ const getBlocDeCompetencesQuery = graphql(`
}
}
blocsDeCompetences(blocDeCompetencesId: $blocDeCompetencesId) {
text
certificationCompetenceBloc {
id
code
label
text
competences {
id
label
Expand Down Expand Up @@ -116,6 +116,7 @@ const CompetenciesBlockPage = () => {
dematerializedFile?.blocsDeCompetences?.[0]?.certificationCompetenceBloc;

const competencesFromBlock = block?.competences;
const blockText = dematerializedFile?.blocsDeCompetences?.[0]?.text;

const defaultValues = useMemo(
() => ({
Expand All @@ -126,12 +127,12 @@ const CompetenciesBlockPage = () => {
(ccd) => ccd.certificationCompetence.id === c.id,
)?.state,
})),
blocText: block?.text || "",
blocText: blockText || "",
}),
[
competencesFromBlock,
dematerializedFile?.certificationCompetenceDetails,
block,
blockText,
],
);

Expand Down

0 comments on commit fffdc64

Please sign in to comment.