Skip to content
Snippets Groups Projects
Unverified Commit 093308d2 authored by Nemanja Glumac's avatar Nemanja Glumac Committed by GitHub
Browse files

Re-wire the `Users` entity to use RTK Query under the hood (#41312)

* Define the types for the `create` user request

* First draft for the create user API using RTK Query

* Export RTK user API

* Define explicit `create` api for the user entity

* Define `updatePassword` mutation

* Wire users entity `resetPasswordManual` to use RTK under the hood

* Use `updatePassword` mutation

* Wire users list calls

* Remove unused `update_password` from services

* Fix the dispatch used to list users

* Dispatch the action type and the payload

* Wire `deactivateUser` to work with RTK

* Wire `reactivateUser` to work with RTK

* Delete unused entries from `UserApi`

* Convert the reducer to use `switch` statement

* Remove unused user `send_invite` endpoint from FE

* Wire `resetPasswordEmail` in users entity to work with RTK

* Provide cache invalidation for the `userApi`

* Add `provideUserListTags` helper

* Pass `email` as a sole argument

* Throw on `get` a user

This endpoint hasn't been used in a long itme.
Removed in https://github.com/metabase/metabase/pull/41334/files#diff-241e0afa11f03a0942eb322aa47695e58496379b0b6d42e6e59ecf6a20fe623cL448

* Use RTK Query to `updateUser`

* Fix wrong syntax

* Use RTK Query to `getUser`

It was used by `.load` and `fetch` after all.

* Export `useUpdateUserMutation`

* Refactor `getRecipientsList`

* Fix response type for the `getUser`

* Pass user id as a sole argument instead of in an object

* Fix users entity `get` method

* Fix the user update password form

* Fix unit tests

* Fix deactivate and reactivate query invocations

See e949812.

* Adjust types according to the feedback

* Order utils alphabetically

* Throw on `delete`

* Revert "Fix unit tests"

This reverts commit 2c329e836427010ad08bfd0511eb1a9df4ba95d6.

* Fix FE unit test mocks

* Rename imports to use plural for consistency

* Fix one last remaining FE unit test
parent da9125f8
No related merge requests found
Showing
with 284 additions and 89 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment