@@ -3,36 +3,63 @@ import { server } from "./config";
33
44class CatalogApi {
55
6+ // get list of all available catalogs
67 static getAllCatalogs ( ) {
7- return axios (
8- {
9- method : 'get' ,
10- url : `${ server } /form/info` ,
11- params : {
12- size : 5000
13- }
8+ return axios ( {
9+ method : 'get' ,
10+ url : `${ server } /form/info` ,
11+ params : {
12+ size : 5000
1413 }
15- ) ;
14+ } ) ;
1615 }
1716
17+ // get full metadata of specified catalog
1818 static getCatalogInfo ( catalogClass ) {
19- return axios . get ( `${ server } /form/info/${ catalogClass } ` ) ;
19+ return axios ( {
20+ method : 'get' ,
21+ url : `${ server } /form/info/${ catalogClass } `
22+ } ) ;
2023 }
2124
25+ // get <size> objects of specified catalog
2226 static getCatalogExtent ( catalogClass ) {
23- return axios . get ( `${ server } /form/objects/${ catalogClass } /info?size=500` ) ;
27+ return axios ( {
28+ method : 'get' ,
29+ url : `${ server } /form/objects/${ catalogClass } /info` ,
30+ params : {
31+ size : 5000
32+ }
33+ } ) ;
2434 }
2535
36+ // get <size> objects of specified catalog with _class property
2637 static getCatalogExtendWithClass ( catalogClass ) {
27- return axios . get ( `${ server } /form/objects/${ catalogClass } /infoclass?size=500&orderby=name` ) ;
38+ return axios ( {
39+ method : 'get' ,
40+ url : `${ server } /form/objects/${ catalogClass } /infoclass` ,
41+ params : {
42+ size : 5000 ,
43+ orderby : 'name'
44+ }
45+ } ) ;
2846 }
2947
48+ // get object by catalog and id
3049 static getFormObjectById ( catalogClass , id ) {
31- return axios . get ( `${ server } /form/object/${ catalogClass } /${ id } ` ) ;
50+ return axios ( {
51+ method : 'get' ,
52+ url : `${ server } /form/object/${ catalogClass } /${ id } `
53+ } ) ;
3254 }
3355
56+
3457 static saveCatalog ( catalogClass , id , catalog ) {
35- return axios . put ( `${ server } /form/object/${ catalogClass } /${ id } ` , catalog ) ;
58+ return axios ( {
59+ method : 'put' ,
60+ url : `${ server } /form/object/${ catalogClass } /${ id } ` ,
61+ data : catalog
62+ } ) ;
3663 }
3764}
3865
0 commit comments