USStateDept / State-TalentMAP

A comprehensive research, bidding, and matching system to match Foreign Service employees with the right skills to available posts and positions. API Layer - https://github.com/USStateDept/State-TalentMAP-API
Other
31 stars 16 forks source link

Reset archived value to previous value if API error occurs #1428

Closed mjoyce91 closed 6 years ago

mjoyce91 commented 6 years ago

If an API error occurs when attempting to archive a glossary term, the local state still changes as if the update were successful - though an error message is still displayed. Reset the state to the original value if an error occurs.

Feedback: https://github.com/18F/State-TalentMAP/pull/1403/files/baf58d1c217d9df0025f638486664250913acd11#diff-82c82977c2df13d0521bb1a7b6ebb8c4

burgwyn commented 6 years ago

Is this similar behavior to #1351?

mjoyce91 commented 6 years ago

Sort of, it's actually the opposite though. On favorites, we rely solely on the API response. With the archival link, we rely solely on local state. We should be using both.