diff --git a/src/app/core/config/api-config.ts b/src/app/core/config/api-config.ts index 025faa86fc8d5f0758f4e7cf997af496c7f3541a..dab1cb1fe6ba4daf7645fdb7861900132c833609 100644 --- a/src/app/core/config/api-config.ts +++ b/src/app/core/config/api-config.ts @@ -68,4 +68,6 @@ export const apiConfig = { urlPublishSolution: '/api/publish', urlSearchPublishRequest: '/api/publish/request/search/revision', withdrawPublishRequestUrl: '/api/publish/request/withdraw/', + urlCatalogPath: '/api/catalog', + urlSiteConfig: '/api/admin/config', }; diff --git a/src/app/core/services/private-catalogs.service.ts b/src/app/core/services/private-catalogs.service.ts index c9266cee3e2edbf9cde61c921d0d10f04dcadbbe..ef5b8f766d74561ed0621dac97a0b78092994d34 100644 --- a/src/app/core/services/private-catalogs.service.ts +++ b/src/app/core/services/private-catalogs.service.ts @@ -935,4 +935,61 @@ export class PrivateCatalogsService { }), ); } + + createCatalog(catalog: Catalog) { + const requestObj = { + request_body: { + ...catalog, + url: 'http://localhost', + }, + }; + const url = apiConfig.apiBackendURL + apiConfig.urlCatalogPath; + + return this._httpSharedService.post(url, undefined, requestObj).pipe( + catchError((error) => { + throw error; + }), + ); + } + + updateCatalog(catalog: Catalog) { + const requestObj = { + request_body: { + ...catalog, + url: 'http://localhost', + }, + }; + const url = apiConfig.apiBackendURL + apiConfig.urlCatalogPath; + + return this._httpSharedService.put(url, undefined, requestObj).pipe( + catchError((error) => { + throw error; + }), + ); + } + + deleteCatalog(catalog: Catalog) { + const url = + apiConfig.apiBackendURL + + apiConfig.urlCatalogPath + + '/' + + catalog.catalogId; + + return this._httpSharedService.delete(url).pipe( + catchError((error) => { + throw error; + }), + ); + } + + getSiteConfig() { + const url = + apiConfig.apiBackendURL + apiConfig.urlSiteConfig + '/site_config'; + + return this._httpSharedService.get(url, undefined).pipe( + catchError((error) => { + throw error; + }), + ); + } } diff --git a/src/environments/environment.ts b/src/environments/environment.ts index e0a56ed7d55e9f9aa1d58ec3f18c09d3a7f976da..87f4dc1fec574da1a6f1df0291aed272c28e7703 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -2,7 +2,7 @@ export const environment = { // local with session production: false, skipAuth: false, - apiBackendURL: 'https://aiexp-dev.ai4europe.eu', + apiBackendURL: 'https://dev02.ki-lab.nrw', isDebugMode: true, logging: { level: {