Closed roberto-butti closed 1 year ago
@joaokamun and @ademarCardoso I also added 3 test cases for testing nested relations and more than 50 relations that allow the APIs to reply with rel_uuids. If you agree, we can merge this PR.
You can see the tests:
vendor/bin/pest --filter "Integration: get one story with Resolved relations"
Looks great!
Ehi @ademarCardoso , removed comments : https://github.com/storyblok/php-client/pull/83/commits/f7b60fc0c33f081694c309ea09553b1958bb790d
…ame conflict
Pull request type
Jira Link: [INT-766(url)
How to test this PR
This issue is in the
resolveRelations()
method in theClient
class.The test case is this one:
The current implementation of resolve relations create an array using as key the first part of the relations. In the test case are:
If you are using as key the first part (before the dot), you have “conflict for:
Now for preserving all the relations, the
resolveRelations
method now creates an array of array like this one:Now in the
insertRelations()
method, instead of checking if the field is equal to the element of the array, I modified the "if condition" to check if the field is in the array.