NYPL / nypl-recap-admin

An admin interface for ReCap/SCSB written in Node/Express/React
0 stars 0 forks source link

Validate inputs and handle errors #20

Closed ktp242 closed 6 years ago

ktp242 commented 6 years ago

This PR focus on adding the functions to validation the date inputs on the client side. Also, the app now displays the errors if there is any from the input.

If either of the date format is not as MM/DD/YYYY, include empty value, after hitting the submit button, the instruction text will change to indicate a further info for patron to enter the correct format of the date. And the request will not be submitted. The result thus won't be changed.

However, if something wrong happened from the server and thus the app doesn't get any valid result back, the result will indicate the error, as The input dates have invalid format or value, please check again.