Consolidates some redundant code in the typeahead controller.
@jupiter007 I noticed one remaining (and hopefully easy to fix) issue when testing all of the changes again:
open a plan on the DMP uploads dashboard and go to the contributors page
Edit the contributor that is marked as the primary contact
Uncheck the primary contact box and save
Then click 'Save and Continue'
It properly shows the error message now, but the contributor disappears from the list. If I refresh the page, the contributor is still there, so it's just a visual issue. This might cause the user to think that the contributor was deleted though and they may try to re-add them.
Consolidates some redundant code in the typeahead controller.
@jupiter007 I noticed one remaining (and hopefully easy to fix) issue when testing all of the changes again:
It properly shows the error message now, but the contributor disappears from the list. If I refresh the page, the contributor is still there, so it's just a visual issue. This might cause the user to think that the contributor was deleted though and they may try to re-add them.