class PublicTagsAPIService {
    constructor(publicAPIRoute) {
        this.publicAPIRoute = publicAPIRoute;
    }

    getPopularTags() {
        return this.publicAPIRoute('tags').one('popular').getList().then(
            (tags) => tags.plain()
        );
    }
}

angular.module('materialscommons').service('publicTagsAPI', PublicTagsAPIService);

class PublicTagsAPIService {
    constructor(Restangular) {
        this.Restangular = Restangular;
    }

    getPopularTags() {
        return this.Restangular.one('v3').one('getPopularTagsForPublishedDatasets').customPOST().then(
            (tags) => tags.plain().data
        );
    }
}

angular.module('materialscommons').service('publicTagsAPI', PublicTagsAPIService);

Switch to actionhero based API
Switch to actionhero based API
