JSON API for Creating Coupon with Configs and Decorators

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
User avatar
Kevin1596
Posts: 28
Joined: 13 Aug 2020, 10:11

JSON API for Creating Coupon with Configs and Decorators

Post by Kevin1596 » 16 Aug 2020, 10:41

Hi,

I am trying to create a coupon with configs and decorators by using JSON API Admin,

this is the request data which I call the API
inside the coupon.config I use the object with decorators key and value
Screen Shot 2020-08-16 at 5.34.06 PM.png
Screen Shot 2020-08-16 at 5.34.06 PM.png (94.92 KiB) Viewed 3743 times
and this is the response I received. As I understand the requirement is coupon.config is an array
Screen Shot 2020-08-16 at 5.34.33 PM.png
Screen Shot 2020-08-16 at 5.34.33 PM.png (102.14 KiB) Viewed 3743 times
The problem is: when I call using the array, such as
coupon.config : [{key, val},{key, val}]
The JSON API will accepted and store the array
However, the backend wont work and keep it the same
{0: [{key, val},{key, val}]}

While using the JQADM the result in database is an object and everything will be fine
{
{key: value},
{key:value}
}

User avatar
aimeos
Administrator
Posts: 8636
Joined: 01 Jan 1970, 00:00

Re: JSON API for Creating Coupon with Configs and Decorators

Post by aimeos » 17 Aug 2020, 06:29

Which Aimeos version do you use? Think, it's already fixed in 2020.07.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
Kevin1596
Posts: 28
Joined: 13 Aug 2020, 10:11

Re: JSON API for Creating Coupon with Configs and Decorators

Post by Kevin1596 » 17 Aug 2020, 07:33

thank you for your reply
This is my environment code
"php": "^7.2.5",
"aimeos/aimeos-laravel": "~2020.04",
"fideloper/proxy": "^4.2",
"fruitcake/laravel-cors": "^1.0",
"guzzlehttp/guzzle": "^6.3",
"laravel/framework": "^7.0",
"laravel/tinker": "^2.0",
"laravel/ui": "^2.0"

could you help me with a example which you call JSON API admin to create and modify Coupon with configs and decorators?

User avatar
aimeos
Administrator
Posts: 8636
Joined: 01 Jan 1970, 00:00

Re: JSON API for Creating Coupon with Configs and Decorators

Post by aimeos » 17 Aug 2020, 07:47

Please update to the current 2020.07 release first as the problem should be fixed there.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
Kevin1596
Posts: 28
Joined: 13 Aug 2020, 10:11

Re: JSON API for Creating Coupon with Configs and Decorators

Post by Kevin1596 » 17 Aug 2020, 08:17

As I upgraded to the 07.2020 version, the issues resolved!

Have a good day, thank you so much for your support!

Post Reply