Skip to content

Commit

Permalink
Merge pull request #93 from heseya/bugfix/MPT-2709
Browse files Browse the repository at this point in the history
Added missing published
  • Loading branch information
daVitekPL authored Oct 28, 2024
2 parents b7bead2 + 62b9944 commit 3ea665b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
7 changes: 0 additions & 7 deletions app/Http/Resources/ProductResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,6 @@
*/
class ProductResource extends ProductWithoutSalesResource
{
public function base(Request $request): array
{
return array_merge(parent::base($request), [
'published' => $this->resource->published,
]);
}

public function view(Request $request): array
{
return array_merge(parent::view($request), [
Expand Down
1 change: 1 addition & 0 deletions app/Http/Resources/ProductWithoutSalesResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public function base(Request $request): array
'purchase_limit_per_user' => $this->resource->purchase_limit_per_user,
'description_html' => $this->when($request->boolean('with_description'), $this->resource->description_html),
'gallery' => $this->when($request->boolean('with_gallery'), MediaResource::collection($this->resource->media)),
'published' => $this->resource->published,
];

return array_merge(
Expand Down
3 changes: 3 additions & 0 deletions tests/Feature/ProductTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,9 @@ public function setUp(): void
'metadata' => [
$metadata->name => $metadata->value,
],
'published' => [
$this->lang,
],
]);

$this->saleProduct = Product::factory()->create([
Expand Down

0 comments on commit 3ea665b

Please sign in to comment.