fix(fournisseurs): résoudre les IRIs
This commit is contained in:
@@ -50,10 +50,12 @@ export function useComposants () {
|
|||||||
composant.constructeurs,
|
composant.constructeurs,
|
||||||
composant.constructeur,
|
composant.constructeur,
|
||||||
)
|
)
|
||||||
const hasConstructeurs =
|
const hasResolvedConstructeurs =
|
||||||
Array.isArray(composant.constructeurs) && composant.constructeurs.length > 0
|
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)
|
const resolved = await ensureConstructeurs(ids)
|
||||||
if (resolved.length) {
|
if (resolved.length) {
|
||||||
composant.constructeurs = resolved
|
composant.constructeurs = resolved
|
||||||
|
|||||||
@@ -50,10 +50,12 @@ export function usePieces () {
|
|||||||
piece.constructeurs,
|
piece.constructeurs,
|
||||||
piece.constructeur,
|
piece.constructeur,
|
||||||
)
|
)
|
||||||
const hasConstructeurs =
|
const hasResolvedConstructeurs =
|
||||||
Array.isArray(piece.constructeurs) && piece.constructeurs.length > 0
|
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)
|
const resolved = await ensureConstructeurs(ids)
|
||||||
if (resolved.length) {
|
if (resolved.length) {
|
||||||
piece.constructeurs = resolved
|
piece.constructeurs = resolved
|
||||||
|
|||||||
@@ -62,10 +62,12 @@ export function useProducts () {
|
|||||||
product.constructeurs,
|
product.constructeurs,
|
||||||
product.constructeur,
|
product.constructeur,
|
||||||
)
|
)
|
||||||
const hasConstructeurs =
|
const hasResolvedConstructeurs =
|
||||||
Array.isArray(product.constructeurs) && product.constructeurs.length > 0
|
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)
|
const resolved = await ensureConstructeurs(ids)
|
||||||
if (resolved.length) {
|
if (resolved.length) {
|
||||||
product.constructeurs = resolved
|
product.constructeurs = resolved
|
||||||
|
|||||||
Reference in New Issue
Block a user