Massively Reduced the number of API requests made by app by caching data in localStorage.
Credits: @vixrant for the suggestion
User details are now stored in localStorage at the time of Login instead of being fetched from API whenever required.
The locally stored details will be updated whenever the user edits his profile details.
Tags are now cached in localStorage and are updated in 3 scenarios:
When we encounter a new tag id which isn't present in our localStorage.
When the user logs out or is forced to log out after his refreshToken Cookie expires (1 week after login).
When a user tries to Register a new account (Updated in this case so he gets a new updated list of all Universities)
If by any chance the user's localStorage is deleted after he is logged in (Could occur when the user clears his browser data), the app will fetch his details and tags from the API again (only once) and store them in localStorage for future use.
The axios config file now sends the Authorization token in headers for every request.
Bug Fix:
Added a check for duplicate entries in University Applications (except for the tag "Other" which can occur multiple times) and Tests (Prevents user from entering same Test name more than once) so user doesn't repeat the same input twice.
Massively Reduced the number of API requests made by app by caching data in localStorage.
Credits: @vixrant for the suggestion
Bug Fix: