fix(fournisseurs): résoudre les IRIs

This commit is contained in:
2026-01-14 23:10:34 +01:00
parent ddce3ff3ae
commit 0bfb69ad13
3 changed files with 15 additions and 9 deletions

View File

@@ -50,10 +50,12 @@ export function useComposants () {
composant.constructeurs,
composant.constructeur,
)
const hasConstructeurs =
Array.isArray(composant.constructeurs) && composant.constructeurs.length > 0
const hasResolvedConstructeurs =
Array.isArray(composant.constructeurs)
&& composant.constructeurs.length > 0
&& composant.constructeurs.every((item) => item && typeof item === 'object')
if (ids.length && !hasConstructeurs) {
if (ids.length && !hasResolvedConstructeurs) {
const resolved = await ensureConstructeurs(ids)
if (resolved.length) {
composant.constructeurs = resolved

View File

@@ -50,10 +50,12 @@ export function usePieces () {
piece.constructeurs,
piece.constructeur,
)
const hasConstructeurs =
Array.isArray(piece.constructeurs) && piece.constructeurs.length > 0
const hasResolvedConstructeurs =
Array.isArray(piece.constructeurs)
&& piece.constructeurs.length > 0
&& piece.constructeurs.every((item) => item && typeof item === 'object')
if (ids.length && !hasConstructeurs) {
if (ids.length && !hasResolvedConstructeurs) {
const resolved = await ensureConstructeurs(ids)
if (resolved.length) {
piece.constructeurs = resolved

View File

@@ -62,10 +62,12 @@ export function useProducts () {
product.constructeurs,
product.constructeur,
)
const hasConstructeurs =
Array.isArray(product.constructeurs) && product.constructeurs.length > 0
const hasResolvedConstructeurs =
Array.isArray(product.constructeurs)
&& product.constructeurs.length > 0
&& product.constructeurs.every((item) => item && typeof item === 'object')
if (ids.length && !hasConstructeurs) {
if (ids.length && !hasResolvedConstructeurs) {
const resolved = await ensureConstructeurs(ids)
if (resolved.length) {
product.constructeurs = resolved