Add server api instance
[arvados-workbench2.git] / src / store / project-reducer.ts
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import { getType } from "typesafe-actions";
6 import { Project } from "../models/project";
7 import actions, { ProjectAction } from "./project-action";
8
9 type ProjectState = Project[];
10
11 const projectsReducer = (state: ProjectState = [], action: ProjectAction) => {
12     switch (action.type) {
13         case getType(actions.createProject): {
14             return [...state, action.payload];
15         }
16         default:
17             return state;
18     }
19 };
20
21 export default projectsReducer;