Fix for ProductResource resource
This commit is contained in:
parent
25b2e42f14
commit
d51f78a8db
2 changed files with 6 additions and 4 deletions
|
|
@ -73,8 +73,9 @@ class ProductResource extends JsonResource
|
|||
if (count($this->product->origins)) {
|
||||
$origins = "";
|
||||
foreach ($this->product->origins as $originValue) {
|
||||
/** @var \App\Enums\Products\OriginEnum $enumValue */
|
||||
foreach (OriginEnum::toArray() as $enumValue) {
|
||||
if (intval($originValue['id']) === $enumValue->value) {
|
||||
if ($originValue === $enumValue->value) {
|
||||
$origins = $origins . $enumValue->label . ", ";
|
||||
}
|
||||
}
|
||||
|
|
@ -83,8 +84,9 @@ class ProductResource extends JsonResource
|
|||
if (count($this->product->claims)) {
|
||||
$claims = "";
|
||||
foreach ($this->product->claims as $originValue) {
|
||||
/** @var \App\Enums\Products\ClaimEnum $enumValue */
|
||||
foreach (ClaimEnum::toArray() as $enumValue) {
|
||||
if (intval($originValue['id']) === $enumValue->value) {
|
||||
if ($originValue === $enumValue->value) {
|
||||
if ($enumValue->value === ClaimEnum::others->value) {
|
||||
$claims = $claims . $enumValue->label . ": " . $this->product->specified_claim . ", ";
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -33,8 +33,8 @@ use Symfony\Component\HttpFoundation\StreamedResponse;
|
|||
* @property array $docs
|
||||
* @property string $url
|
||||
* @property enum $certification
|
||||
* @property object $origins
|
||||
* @property object $claims
|
||||
* @property array<integer> $origins
|
||||
* @property array<integer> $claims
|
||||
* @property string $specified_claim
|
||||
* @property enum $distribution_network
|
||||
* @property enum $ray
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue