-
Notifications
You must be signed in to change notification settings - Fork 98
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
feat(rest): endpoint to update a vendor. #2606
base: main
Are you sure you want to change the base?
Conversation
407bf5d
to
26d4021
Compare
@deo002 can you please test this PR? |
26d4021
to
6c11f50
Compare
Hi @deo002 , can you try now. |
6c11f50
to
c0704b5
Compare
Thanks for quick response. |
Signed-off-by: Rudra Chopra <prabhuchopra@gmail.com>
c0704b5
to
25635e5
Compare
If user updates a single field, like shortName then the other two fields will be taken as null by default. Therefore in the above ss it will update shortname only and response will be 200 even if it says fullName is null because by default also fullName will be taken as null and it wont update the fullName field of the vendor. On the other hand if you enter a single field as null in body then it will give 400 status code because all the three fields will be considered as null. |
@RequestBody Vendor vendor | ||
) { | ||
User sw360User = restControllerHelper.getSw360UserFromAuthentication(); | ||
if (vendor.getFullname() == null && vendor.getShortname() == null && vendor.getUrl() == null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't these conditions be ||
instead of &&
to prevent reading and updating null
values for some fields?
Issue: #2604
Description: endpoint to update a vendor.