feat(entry): filter out replaced variants in EntryResource to improve data accuracy
This commit is contained in:
parent
69bea10519
commit
e6b5da366c
|
|
@ -16,7 +16,10 @@ class EntryResource extends JsonResource
|
||||||
'id' => $this->id,
|
'id' => $this->id,
|
||||||
'title' => $this->nombre,
|
'title' => $this->nombre,
|
||||||
'description' => $this->descripcion,
|
'description' => $this->descripcion,
|
||||||
'variants' => $this->variants->toArray(),
|
'variants' => $this->variants
|
||||||
|
->whereNull('replaced_by_variant_id')
|
||||||
|
->values()
|
||||||
|
->toArray(),
|
||||||
'price' => $this->precio,
|
'price' => $this->precio,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue