Revert "feat(variants): implement restoration of previously suspended variants with usable dates"
This reverts commit 3a4f6b64d2.
This commit is contained in:
@@ -12,12 +12,7 @@ class EntryResource extends JsonResource
|
||||
/** @return array<string, mixed> */
|
||||
public function toArray(Request $request): array
|
||||
{
|
||||
$variant = $this->variants
|
||||
->filter(fn ($candidate): bool => $candidate->sales_disabled_at === null
|
||||
&& $candidate->replaced_by_variant_id === null)
|
||||
->sortByDesc('id')
|
||||
->first()
|
||||
?? $this->variants->sortByDesc('id')->firstOrFail();
|
||||
$variant = $this->variants->sole();
|
||||
|
||||
return [
|
||||
'id' => $this->id,
|
||||
|
||||
Reference in New Issue
Block a user