yari
yari copied to clipboard
MP-30: connect collections v2 api
I've left the individual commits in case they're of any use - I don't think they are, a bunch of stuff changes between them, so I'll squash and rebase this branch once reviewed.
There's a few added pieces of functionality, but pr is mostly around setting up swr and connecting the api in a sensible way. Notably there's pieces missing which will come in future PRs (I'll file tickets for these):
- Filter/sort with search bar
- Update styling to match designs
- Proper "loading" states when data is being fetched, shown from swr cache, or an edit/delete is pending
- Proper handling of errors: currently they're thrown but not caught
- Cleverer swr cache mutation: optimistically modifying the cache locally when we know what an update will do
- (Possibly) persisting swr cache in localstorage