Doesn't modify the frontend when models are updated with jsonapi

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!
Ashley23
Posts: 4
Joined: 10 Nov 2023, 08:08

Doesn't modify the frontend when models are updated with jsonapi

Post by Ashley23 » 10 Nov 2023, 08:27

Laravel framework version: 10.8.0
Aimeos Laravel version: 2023.04.*
PHP Version: 8.1.18 (cli)
Environment: Linux (Ubuntu)

When the models are updated with jsonapi, everything is accurate in admin panel, but things in the frontend doesn't seem so. Especially when they are changed.

For example, in the beginning 'A' product is included to 'First' category everything is okay. And the 'A' product's category is changed to 'Second' category with jsonapi, in the admin panel the 'A' product has 'Second' category but in the front-end the 'A' product is included to 'First' category. Then, when that 'A' product is just resaved in admin panel, everything is okay.

Is this problem associated with api controller or with caches?

PS: I've tried clearing all caches, didn't work either.

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

Re: Doesn't modify the frontend when models are updated with jsonapi

Post by aimeos » 14 Nov 2023, 07:51

Most likely because the product index isn't updated when you change a product using the JsonAdm API. You have to use the "index" endpoint of the JsonAdm API to rebuild the index for the passed product IDs:

Code: Select all

POST /admin/default/jsonadm?resource=index
body: {"data": ["<id>","<id>"]}
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply