You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In both the Admin API and when using the ProductVariantService directly, if you update a variant and specify that it should have the same options that it already has, there is an error that says that a variant with those options already exists. Instead, I think that updating a variant to have the same options that it already has should be a no-op. It makes it easier to update a variant when you can specify all of the properties that you want it to have, including the options, without triggering errors.
To Reproduce
Steps to reproduce the behavior:
Create a variant.
Use the updateProductVariants mutation from the Admin API, and specify the option IDs that the variant already has.
There is an error.
Here is an example of updating a variant from the test data without specifying optionIds:
Here it is with specifying optionIDs:
Expected behavior
The update should succeed, since it won't cause any harm or inconsistency.
Environment (please complete the following information):
@vendure/core version: 3.0.5
Nodejs version: v20.14.0
Database (mysql/postgres etc): Postgres
The text was updated successfully, but these errors were encountered:
Describe the bug
In both the Admin API and when using the ProductVariantService directly, if you update a variant and specify that it should have the same options that it already has, there is an error that says that a variant with those options already exists. Instead, I think that updating a variant to have the same options that it already has should be a no-op. It makes it easier to update a variant when you can specify all of the properties that you want it to have, including the options, without triggering errors.
To Reproduce
Steps to reproduce the behavior:
updateProductVariants
mutation from the Admin API, and specify the option IDs that the variant already has.Here is an example of updating a variant from the test data without specifying optionIds:
Here it is with specifying optionIDs:
Expected behavior
The update should succeed, since it won't cause any harm or inconsistency.
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: