Closed syphax-bouazzouni closed 1 year ago
Hi, @jvendetti Thanks for the time that you took for the reviews (and sorry for the troubles behind it) I fixed the issue that you mentioned (see screenshot bellow)
My original goal is to reuse the error messages sent by the backend. In the case of Bioportal submission, there are only 2 possible errors: missing contact and upload files.
But in Agroportal we have many more fields in that form to test their validity. So it is necessary to reuse the backed errors message and not rewrite them in the front. Something like below
Context
Before https://github.com/ncbo/ontologies_api_ruby_client/pull/13, the HTTP requests (update or create) return
nil
(ruby null) if successful and the response body if error.After merging https://github.com/ncbo/ontologies_api_ruby_client/pull/13, now all the HTTP would return a response, success, or error.
Issue
the old way of testing if the response is a success (
response.nil?
) will no more work because we don't return nil if successSolution
Now the code will test the response status to know if it is a success or not
Changes
response_error?
helper