X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/f0d519637c997df11d5b1a1b32b3d9e4a2872325..6149700b801fc2cdb83b0e700bbb319850ed471d:/src/store/favorites/favorites-actions.ts diff --git a/src/store/favorites/favorites-actions.ts b/src/store/favorites/favorites-actions.ts index 9e1b3ef1c2..e5a8e591d2 100644 --- a/src/store/favorites/favorites-actions.ts +++ b/src/store/favorites/favorites-actions.ts @@ -2,7 +2,7 @@ // // SPDX-License-Identifier: AGPL-3.0 -import { unionize, ofType, UnionOf } from "unionize"; +import { unionize, ofType, UnionOf } from "~/common/unionize"; import { Dispatch } from "redux"; import { RootState } from "../store"; import { checkFavorite } from "./favorites-reducer"; @@ -13,7 +13,7 @@ export const favoritesActions = unionize({ TOGGLE_FAVORITE: ofType<{ resourceUuid: string }>(), CHECK_PRESENCE_IN_FAVORITES: ofType(), UPDATE_FAVORITES: ofType>() -}, { tag: 'type', value: 'payload' }); +}); export type FavoritesAction = UnionOf; @@ -40,7 +40,7 @@ export const toggleFavorite = (resource: { uuid: string; name: string }) => }); }; -export const checkPresenceInFavorites = (resourceUuids: string[]) => +export const updateFavorites = (resourceUuids: string[]) => (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => { const userUuid = getState().auth.user!.uuid; dispatch(favoritesActions.CHECK_PRESENCE_IN_FAVORITES(resourceUuids)); @@ -50,4 +50,3 @@ export const checkPresenceInFavorites = (resourceUuids: string[]) => dispatch(favoritesActions.UPDATE_FAVORITES(results)); }); }; -