Merge branch 'fix/mapPivot' into 'develop'

fix: 🐛 fix error on multiselect helper function, when no model was passed

See merge request ldc-web/projets/ldc!91
This commit is contained in:
karl.muller 2025-12-17 14:17:01 +00:00
commit f56bd47bf1
2 changed files with 4 additions and 4 deletions

View file

@ -137,7 +137,7 @@ export default function Form({
}),
).ucFirst().value()}
placeholder={"ex: " + enumDocStatus.unpublished.label}
selected={String(data.status)}
selected={Number(data.status)}
setData={setData}
/>
</FieldsetWrapper>

View file

@ -13,16 +13,16 @@ export function mapPivotOptions<
/** If we have a translatable field we pass the current locale */
locale?: string | null
) {
const options = model.map((opt) => {
const options = (model && model.length) ? model.map((opt) => {
const raw = opt[valueKey as keyof typeof opt] as unknown as string;
return {
value: opt.id.toString(),
label: locale && typeof raw === "object"
? raw[locale]
: raw
};
});
}) : [];
const defaultValue: string[] = data && valueKey
? data.map((item) => {
return item.id.toString();