add properties to create project form
[arvados.git] / src / store / api-client-authorizations / api-client-authorizations-reducer.ts
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import { 
6     apiClientAuthorizationsActions, 
7     ApiClientAuthorizationsActions 
8 } from '~/store/api-client-authorizations/api-client-authorizations-actions';
9 import { ApiClientAuthorization } from '~/models/api-client-authorization';
10
11 export type ApiClientAuthorizationsState = ApiClientAuthorization[];
12
13 const initialState: ApiClientAuthorizationsState = [];
14
15 export const apiClientAuthorizationsReducer = 
16     (state: ApiClientAuthorizationsState = initialState, action: ApiClientAuthorizationsActions): ApiClientAuthorizationsState =>
17         apiClientAuthorizationsActions.match(action, {
18             SET_API_CLIENT_AUTHORIZATIONS: apiClientAuthorizations => apiClientAuthorizations,
19             REMOVE_API_CLIENT_AUTHORIZATION: (uuid: string) => 
20                 state.filter((apiClientAuthorization) => apiClientAuthorization.uuid !== uuid),
21             default: () => state
22         });