diff -r 7af67d500dd5 -r df751568fda6 clientjs/packages/dashboard-components/src/actions.js --- a/clientjs/packages/dashboard-components/src/actions.js Mon Sep 17 00:28:58 2018 +0200 +++ b/clientjs/packages/dashboard-components/src/actions.js Mon Sep 17 01:35:46 2018 +0200 @@ -2,7 +2,7 @@ import fetch from 'isomorphic-fetch'; import _ from 'lodash'; -import { getTerms, toBase64 } from './utils'; +import { getTerms, getTermId } from './utils'; export const REQUEST_ANNOTATIONS = 'REQUEST_ANNOTATIONS'; @@ -45,9 +45,9 @@ } export const FETCH_MESSAGES_COUNT = 'FETCH_MESSAGES_COUNT'; -export function fetchMessagesCount(terms, discussionUrl) { +export function fetchMessagesCount(terms, discussionUrl, dashboardId) { const url = `${discussionUrl}count`; - const terms64 = _.map(terms, toBase64); + const terms64 = _.map(terms, term => getTermId(term, dashboardId)); return function (dispatch) { dispatch(requestMessagesCount(url, terms, terms64)); @@ -74,7 +74,7 @@ } export const FETCH_ANNOTATIONS = 'FETCH_ANNOTATIONS'; -export function fetchAnnotations(url, discussionUrl) { +export function fetchAnnotations(url, discussionUrl, dashboardId) { return function (dispatch) { dispatch(requestAnnotations(url)); @@ -87,7 +87,7 @@ const annotations = json.rows; const terms = getTerms(annotations); - dispatch(fetchMessagesCount(Object.keys(terms), discussionUrl)); + dispatch(fetchMessagesCount(Object.keys(terms), discussionUrl, dashboardId)); dispatch(receiveAnnotations(url, annotations, terms)); }); };