X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/2e60bb998178752c3a126f077cbb891b597ed91e..4076b2736c50e6122d3d840f9c1f6f7d2cf81c28:/src/store/collection-panel/collection-panel-reducer.ts diff --git a/src/store/collection-panel/collection-panel-reducer.ts b/src/store/collection-panel/collection-panel-reducer.ts index 61f4127fae..2c3edf1a5a 100644 --- a/src/store/collection-panel/collection-panel-reducer.ts +++ b/src/store/collection-panel/collection-panel-reducer.ts @@ -3,12 +3,12 @@ // SPDX-License-Identifier: AGPL-3.0 import { collectionPanelActions, CollectionPanelAction } from "./collection-panel-action"; -import { CollectionResource } from "../../models/collection"; -import { LinkResource } from "../../models/link"; +import { CollectionResource } from "~/models/collection"; +import { TagResource } from "~/models/tag"; export interface CollectionPanelState { item: CollectionResource | null; - tags: LinkResource[]; + tags: TagResource[]; } const initialState = { @@ -20,6 +20,7 @@ export const collectionPanelReducer = (state: CollectionPanelState = initialStat collectionPanelActions.match(action, { default: () => state, LOAD_COLLECTION_SUCCESS: ({ item }) => ({ ...state, item }), - LOAD_COLLECTION_TAGS_SUCCESS: ({ tags }) => ({...state, tags}), - CREATE_COLLECTION_TAG_SUCCESS: ({ tag }) => ({...state, tags: [...state.tags, tag] }) + LOAD_COLLECTION_TAGS_SUCCESS: ({ tags }) => ({...state, tags }), + CREATE_COLLECTION_TAG_SUCCESS: ({ tag }) => ({...state, tags: [...state.tags, tag] }), + DELETE_COLLECTION_TAG_SUCCESS: ({ uuid }) => ({...state, tags: state.tags.filter(tag => tag.uuid !== uuid) }) });