We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
API Platform version(s) affected: "@api-platform/admin": "^2.6.0" and "api-platform/core": "^2.6"
Description
Hi,
We are using ApiPlatform with react-admin and we got a problem, Got this entity and the related on VehicleType
class Formula { /** * @var \Ramsey\Uuid\UuidInterface * * @ORM\Id * @ORM\Column(type="uuid", unique=true) * @ORM\GeneratedValue(strategy="CUSTOM") * @ORM\CustomIdGenerator(class=UuidGenerator::class) */ private $id; .... /** * @ORM\ManyToOne(targetEntity=VehicleType::class, inversedBy="formulas") * @ORM\JoinColumn(nullable=false) */ #[Groups([ "read_formula", "write_formula"])] private $vehicleType; ... }
On the react side useEmbedded is enabled :
const dataProvider = baseHydraDataProvider( entrypoint, fetchHydra, apiDocumentationParser, true // useEmbedded parameter );
But when i m on FormulaEdit :
const FormulaEdit = (props) => { return ( <EditGuesser {...props}> <InputGuesser source="name" /> <ReferenceInput source="vehicleType" reference="vehicle_types"> <SelectInput optionText="label" /> </ReferenceInput> </EditGuesser> ); };
I got the select but not selected with my db value If i select one value, it well saved. If i use
<ReferenceInput source="vehicleType.@id" reference="vehicle_types"> <SelectInput optionText="label" /> </ReferenceInput>
The field is filled, but on save i got the error :
hydra:description: "Nested documents for attribute "vehicleType" are not allowed. Use IRIs instead."
What is the good method to deal with relation, in documentation we only found the first method but field is not filled :'(
The text was updated successfully, but these errors were encountered:
Is this PR helping you? api-platform/docs#1144
Sorry, something went wrong.
@alanpoulain Thanks a lot !!!!!!
No branches or pull requests
API Platform version(s) affected: "@api-platform/admin": "^2.6.0" and "api-platform/core": "^2.6"
Description
Hi,
We are using ApiPlatform with react-admin and we got a problem,
Got this entity and the related on VehicleType
On the react side useEmbedded is enabled :
But when i m on FormulaEdit :
I got the select but not selected with my db value
If i select one value, it well saved.
If i use
The field is filled, but on save i got the error :
hydra:description: "Nested documents for attribute "vehicleType" are not allowed. Use IRIs instead."
What is the good method to deal with relation, in documentation we only found the first method but field is not filled :'(
The text was updated successfully, but these errors were encountered: