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

Vendor Id treated as a mandatory field for adding products via POST #27

Closed
alaingmail opened this issue Feb 24, 2017 · 1 comment
Closed

Comments

@alaingmail
Copy link

Hi,

When I try to add a product via a POST call to the plugin I get a validation error when the VendorId is zero.

This occurs because there is validation attribute [ValidateVendor] attached to the VendorId property of the ProductDto class. This is obviously by design, but it does not seem to match the rules of the NopCommerce site. Within the site you can create and edit a product with Vendor set to none which equates to a zero id.

I altered the ValidateVendor's Validate method to ignore the validation routine when a vendor id is zero to get around this error.

Have I got this rule wrong?

Alain

@poyker
Copy link
Member

poyker commented Jun 7, 2017

@alaingmail

I think this commit has corrected the issue already.

@poyker poyker closed this as completed Jun 7, 2017
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

No branches or pull requests

2 participants