X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/df1ebc0e3184afd3fb66414651fc1aec713928bf..37516bc14fdfe634c78764c15f3a8eb3a09b403c:/services/workbench2/src/views-components/context-menu/action-sets/favorite-action-set.ts diff --git a/services/workbench2/src/views-components/context-menu/action-sets/favorite-action-set.ts b/services/workbench2/src/views-components/context-menu/action-sets/favorite-action-set.ts index ee012fb185..bdc4b07a24 100644 --- a/services/workbench2/src/views-components/context-menu/action-sets/favorite-action-set.ts +++ b/services/workbench2/src/views-components/context-menu/action-sets/favorite-action-set.ts @@ -2,16 +2,22 @@ // // SPDX-License-Identifier: AGPL-3.0 -import { ContextMenuActionSet } from "../context-menu-action-set"; -import { ToggleFavoriteAction } from "../actions/favorite-action"; -import { toggleFavorite } from "store/favorites/favorites-actions"; -import { favoritePanelActions } from "store/favorite-panel/favorite-panel-action"; +import { ContextMenuActionSet } from '../context-menu-action-set'; +import { ToggleFavoriteAction } from '../actions/favorite-action'; +import { toggleFavorite } from 'store/favorites/favorites-actions'; +import { favoritePanelActions } from 'store/favorite-panel/favorite-panel-action'; -export const favoriteActionSet: ContextMenuActionSet = [[{ - component: ToggleFavoriteAction, - execute: (dispatch, resource) => { - dispatch(toggleFavorite(resource)).then(() => { - dispatch(favoritePanelActions.REQUEST_ITEMS()); - }); - } -}]]; +export const favoriteActionSet: ContextMenuActionSet = [ + [ + { + component: ToggleFavoriteAction, + execute: (dispatch, resources) => { + resources.forEach((resource) => + dispatch(toggleFavorite(resource)).then(() => { + dispatch(favoritePanelActions.REQUEST_ITEMS()); + }) + ); + }, + }, + ], +];