Create collection-panel-files actions and reducer
[arvados-workbench2.git] / src / store / auth / auth-reducer.ts
index f6974fd2073be49a5c01fe6677bff22edbc4ae8d..366385d50b506de529139f3f75151762f6a6285a 100644 (file)
@@ -2,7 +2,7 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import actions, { AuthAction } from "./auth-action";
+import { authActions, AuthAction } from "./auth-action";
 import { User } from "../../models/user";
 import { authService } from "../../services/services";
 import { removeServerApiAuthorizationHeader, setServerApiAuthorizationHeader } from "../../common/api/server-api";
@@ -12,8 +12,8 @@ export interface AuthState {
     apiToken?: string;
 }
 
-const authReducer = (state: AuthState = {}, action: AuthAction) => {
-    return actions.match(action, {
+export const authReducer = (state: AuthState = {}, action: AuthAction) => {
+    return authActions.match(action, {
         SAVE_API_TOKEN: (token: string) => {
             authService.saveApiToken(token);
             setServerApiAuthorizationHeader(token);
@@ -45,5 +45,3 @@ const authReducer = (state: AuthState = {}, action: AuthAction) => {
         default: () => state
     });
 };
-
-export default authReducer;