import { post, getJSON } from '../helpers/request';
export const getFavorites = (): Promise<Object> => (
- getJSON('/api/favourites')
+ getJSON('/api/favorites/search')
);
export function addFavorite (component: string) {
fetchFavorite (): Promise<*> {
return getFavorites().then(r => {
- this.favorite = r.map(f => {
+ this.favorite = r.favorites.map(f => {
const isFile = ['FIL', 'UTS'].indexOf(f.qualifier) !== -1;
return {
url: window.baseUrl + '/dashboard/index?id=' + encodeURIComponent(f.key) + window.dashboardParameters(true),