Skip to content
Snippets Groups Projects
Commit d38a3278 authored by Kawtar Laariche's avatar Kawtar Laariche
Browse files

#25: add create, update, delete catalog function

parent 31e7818a
No related branches found
No related tags found
1 merge request!13Features/catalogs page
...@@ -68,4 +68,6 @@ export const apiConfig = { ...@@ -68,4 +68,6 @@ export const apiConfig = {
urlPublishSolution: '/api/publish', urlPublishSolution: '/api/publish',
urlSearchPublishRequest: '/api/publish/request/search/revision', urlSearchPublishRequest: '/api/publish/request/search/revision',
withdrawPublishRequestUrl: '/api/publish/request/withdraw/', withdrawPublishRequestUrl: '/api/publish/request/withdraw/',
urlCatalogPath: '/api/catalog',
urlSiteConfig: '/api/admin/config',
}; };
...@@ -935,4 +935,61 @@ export class PrivateCatalogsService { ...@@ -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;
}),
);
}
} }
...@@ -2,7 +2,7 @@ export const environment = { ...@@ -2,7 +2,7 @@ export const environment = {
// local with session // local with session
production: false, production: false,
skipAuth: false, skipAuth: false,
apiBackendURL: 'https://aiexp-dev.ai4europe.eu', apiBackendURL: 'https://dev02.ki-lab.nrw',
isDebugMode: true, isDebugMode: true,
logging: { logging: {
level: { level: {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment