Merge branch 'master'
[arvados-workbench2.git] / src / store / auth / auth-action.ts
index dbf9a0f4190db63905525b41f3185787d25e86f8..e18c78b106f8578b2d396127c74f486f3d62d2ff 100644 (file)
@@ -2,16 +2,8 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import { serverApi } from "../../common/server-api";
 import { ofType, default as unionize, UnionOf } from "unionize";
-import { Dispatch } from "redux";
-
-export interface UserDetailsResponse {
-    email: string;
-    first_name: string;
-    last_name: string;
-    is_admin: boolean;
-}
+import { UserDetailsResponse } from "../../services/auth-service/auth-service";
 
 const actions = unionize({
     SAVE_API_TOKEN: ofType<string>(),
@@ -27,16 +19,3 @@ const actions = unionize({
 
 export type AuthAction = UnionOf<typeof actions>;
 export default actions;
-
-export const getUserDetails = () => (dispatch: Dispatch) => {
-    dispatch(actions.USER_DETAILS_REQUEST());
-    serverApi
-        .get<UserDetailsResponse>('/users/current')
-        .then(resp => {
-            dispatch(actions.USER_DETAILS_SUCCESS(resp.data));
-        })
-        // .catch(err => {
-        // });
-};
-
-