UNPKG

cluedin-widget

Version:

This project contains all the pages needed for browsing entities and searching them. The aim is to replace the CluedIn.Webapp project with this one when all the pages ( including the Admin page ) will be ported to REACT.

32 lines (27 loc) 908 B
var request = require( '../helpers/request' ); var entityAPI = require( '../../iso/entity' ); module.exports = { getLastOrganizations: ( page ) => { let url = 'api/v1/generic/latestorganizations'; if( page ) { url += '?page=' + page; } return request.apiRequest( 'GET', url ).then( function( resp ) { return resp.body.map( ( entity ) => { return entityAPI.toVM( entity, true, resp.__token ); } ); } ); }, current: () => { let url = 'api/organization'; return request.apiRequest( 'GET', url ).then( ( resp ) => { return resp.body; } ); }, getById: ( id ) => { let url = 'api/entity/code?id=' + '/Organization%23CluedIn:' + id; return request.apiRequest( 'GET', url ).then( ( resp ) => { return resp.body; } ); } };