feat(entry): refine variant selection logic to exclude replaced variants and add unit tests for replacement behavior
This commit is contained in:
@@ -12,7 +12,7 @@ class EntryResource extends JsonResource
|
||||
/** @return array<string, mixed> */
|
||||
public function toArray(Request $request): array
|
||||
{
|
||||
$variant = $this->variants->sole();
|
||||
$variant = $this->variants->whereNull('replaced_by_variant_id')->sole();
|
||||
|
||||
return [
|
||||
'id' => $this->id,
|
||||
|
||||
Reference in New Issue
Block a user