Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pass useEmbedded to mercure manager's data transformer #529

Merged

Conversation

PawelSuwinski
Copy link
Contributor

@PawelSuwinski PawelSuwinski commented Feb 27, 2024

Data provider does not pass useEmbedded setting to mercure manager's data transformer, default value (false) is always used here.

So if there is any embedded field on the list it is cleared (as side effect) by mercure update, ex:

  <NumberField
     label="Price"
     source="cost.price"
     options={{ style: "currency", currency: "EUR" }}
   />

fetched data:

      (...)
      "cost": {
        "@id": "/costs/375384",
        "@type": "https://schema.org/PriceSpecification",
        "price": 10,
        "priceCurrency": "EUR",
       },

But updated record that can't be properly rendered will be:

{
  (...)
  cost: '/costs/375384`,
}

This PR fix this passing useEmbedded prop to mercure dataTransformer.

@dunglas dunglas merged commit 62e98b0 into api-platform:main Mar 6, 2024
1 check passed
@dunglas
Copy link
Member

dunglas commented Mar 6, 2024

Thank you!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants