short icon indicating copy to clipboard operation
short copied to clipboard

[Refactor] Consolidate all similar error actions into a single error type

Open rohithbalaji123 opened this issue 5 years ago • 1 comments

What is frustrating you? The number of actions in reducers is increasing as and when a new feature is added. There are a lot of very similar actions like RAISE_CREATE_SHORT_LINK_ERROR, RAISE_GET_USER_SHORT_LINKS_ERROR, RAISE_GET_CHANGELOG_ERROR and if we follow the same pattern, there will be many more for each of CRUD operations of changelogs, users or shortlinks in admin panel which updates the same global states.

Your solution We could consolidate based on the type of final action it performs instead of the cause which triggers that action(say RAISE_ERROR_MODAL). The suggested pattern is already being followed for input validation errors for longLink and alias.

rohithbalaji123 avatar Jun 24 '20 19:06 rohithbalaji123

This is a tech debt. We, as a team, will have to figure out a solution for this.

magicoder10 avatar Jun 25 '20 07:06 magicoder10