projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Introduce service repository
[arvados.git]
/
src
/
store
/
auth
/
auth-action.ts
diff --git
a/src/store/auth/auth-action.ts
b/src/store/auth/auth-action.ts
index e9930a02836da5d66c7e062813a5fd292784f973..8b268cce5d5cb83b68f7a73e9a4b66936f4dd8c3 100644
(file)
--- a/
src/store/auth/auth-action.ts
+++ b/
src/store/auth/auth-action.ts
@@
-4,8
+4,9
@@
import { ofType, default as unionize, UnionOf } from "unionize";
import { Dispatch } from "redux";
import { ofType, default as unionize, UnionOf } from "unionize";
import { Dispatch } from "redux";
-import { authService } from "../../services/services";
import { User } from "../../models/user";
import { User } from "../../models/user";
+import { RootState } from "../store";
+import { ServiceRepository } from "../../services/services";
export const authActions = unionize({
SAVE_API_TOKEN: ofType<string>(),
export const authActions = unionize({
SAVE_API_TOKEN: ofType<string>(),
@@
-19,9
+20,9
@@
export const authActions = unionize({
value: 'payload'
});
value: 'payload'
});
-export const getUserDetails = () => (dispatch: Dispatch): Promise<User> => {
+export const getUserDetails = () => (dispatch: Dispatch
, getState: () => RootState, services: ServiceRepository
): Promise<User> => {
dispatch(authActions.USER_DETAILS_REQUEST());
dispatch(authActions.USER_DETAILS_REQUEST());
- return authService.getUserDetails().then(details => {
+ return
services.
authService.getUserDetails().then(details => {
dispatch(authActions.USER_DETAILS_SUCCESS(details));
return details;
});
dispatch(authActions.USER_DETAILS_SUCCESS(details));
return details;
});