Skip to content

Add useEntityActions hooks

Alex Gleason requested to merge create-group-hook into develop

Summary

Adds an initial draft of useEntityActions, which exposes functions createEntity() and deleteEntity(). Attempt to make group creation go through it (not fully tested).

Initially I was looking at react-query's useMutation hook, but I think the API I ended up with makes a bit more sense. It's guaranteed to return a promise on those actions, so you can do whatever you need with the promise itself.

Things to do later:

  • Optimistic creation/deletion
  • Updating an entity (PUT)

Merge request reports

Loading