1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import { Dispatch } from 'redux';
6 import { ServiceRepository } from 'services/services';
7 import { propertiesActions } from 'store/properties/properties-actions';
8 import { VOCABULARY_PROPERTY_NAME, DEFAULT_VOCABULARY } from './vocabulary-selectors';
9 import { isVocabulary } from 'models/vocabulary';
11 export const loadVocabulary = async (dispatch: Dispatch, _: {}, { vocabularyService }: ServiceRepository) => {
12 const vocabulary = await vocabularyService.getVocabulary();
13 dispatch(propertiesActions.SET_PROPERTY({
14 key: VOCABULARY_PROPERTY_NAME,
15 value: isVocabulary(vocabulary)