JSON API - Double Relationship resources
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!
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
JSON API - Double Relationship resources
Aimeos laravel 2020.10*
when I called API to catalog endpoint to get the data
with var params = {
include: 'catalog,product,text,media'
};
the response have the double of TEXT resources of the included Catalog
when I called API to catalog endpoint to get the data
with var params = {
include: 'catalog,product,text,media'
};
the response have the double of TEXT resources of the included Catalog
Code: Select all
var url = `https://laravel.demo.aimeos.org/default/jsonapi`; // Base URL from config
var promise = $.ajax( url, {
method: "OPTIONS",
dataType: "json"
});
promise.done( function( options ) {
var args = {};
var params = {
include: 'catalog,product,text,media'
};
console.log(options)
console.log('end points')
console.log(options.meta.resources)
var result = $.ajax({
method: "GET",
dataType: "json",
url: `${options.meta.resources['catalog']}`,
data: params
});
result.done( function( result ) {
console.log('resource data')
console.log( result.data );
});
});
Re: JSON API - Double Relationship resources
If you add "include=catalog", the response will also include all subcategories and these categories have texts, images and prodducts themselves which are also added in the "included" section.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,

Re: JSON API - Double Relationship resources
the problem is in the Included Catalog:
the relate texts of included catalog are doubled
Example: as the screen shot we have text with Id 40727 is double
the relate texts of included catalog are doubled
Example: as the screen shot we have text with Id 40727 is double
Re: JSON API - Double Relationship resources
you could check it by calling my request on https://laravel.demo.aimeos.org/default and review the response
Re: JSON API - Double Relationship resources
You are right, the relationship entries for texts are duplicate:
https://laravel.demo.aimeos.org/default ... retty=true
https://laravel.demo.aimeos.org/default ... retty=true
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,

Re: JSON API - Double Relationship resources
OK, it's fixed in aimeos/ai-client-jsonapi:2020.10.x-dev
Can you confirm?
Can you confirm?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,

Re: JSON API - Double Relationship resources
I will confirm it!
another point is, It seems that Stock also got relate problem
![Image]()
another point is, It seems that Stock also got relate problem
Re: JSON API - Double Relationship resources
Your screenshot is missing. Can you also post an URL of the demo installation where we can see the problem?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,
