1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
6 apiClientAuthorizationsActions,
7 ApiClientAuthorizationsActions
8 } from '~/store/api-client-authorizations/api-client-authorizations-actions';
9 import { ApiClientAuthorization } from '~/models/api-client-authorization';
11 export type ApiClientAuthorizationsState = ApiClientAuthorization[];
13 const initialState: ApiClientAuthorizationsState = [];
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),