Skip to content

Commit

Permalink
chore: use new backend in data-service-catalog
Browse files Browse the repository at this point in the history
  • Loading branch information
NilsOveTen committed Jan 9, 2025
1 parent 385671b commit 34f63d3
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 12 deletions.
1 change: 1 addition & 0 deletions apps/catalog-portal/.env.serve.e2e
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ CONCEPT_CATALOG_BASE_URI=https://catalog-portal.staging.fellesdatakatalog.digdir
CONCEPT_CATALOG_FRONTEND=https://begrepskatalog.staging.fellesdatakatalog.digdir.no
DATASET_CATALOG_BASE_URI=https://dataset-catalog.staging.fellesdatakatalog.digdir.no
DATASERVICE_CATALOG_BASE_URI=https://dataservice-catalog.staging.fellesdatakatalog.digdir.no
DATA_SERVICE_CATALOG_BASE_URI=https://data-service-catalog.api.staging.fellesdatakatalog.digdir.no
CONCEPT_CATALOG_BASE_URI=https://concept-catalog.staging.fellesdatakatalog.digdir.no
RECORDS_OF_PROCESSING_ACTIVITIES_GUI_BASE_URI=https://registrering-protokoll.staging.fellesdatakatalog.digdir.no
SERVICE_CATALOG_BASE_URI=https://service-catalog.api.staging.fellesdatakatalog.digdir.no
Expand Down
2 changes: 1 addition & 1 deletion apps/catalog-portal/app/actions/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import {
getAllDatasetCatalogs,
getAllDataServiceCatalogs,
oldGetAllDataServiceCatalogs as getAllDataServiceCatalogs,
getAllConceptCatalogs,
getAllServiceCatalogs,
getAllProcessingActivities,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ spec:
secretKeyRef:
name: commonurl-demo
key: DATA_SERVICE_CATALOG_FRONTEND
- name: DATASERVICE_CATALOG_BASE_URI
- name: DATA_SERVICE_CATALOG_BASE_URI
valueFrom:
secretKeyRef:
name: commonurl-demo
key: DATASERVICE_CATALOG_BASE_URI
key: DATA_SERVICE_CATALOG_BASE_URI
- name: CATALOG_PORTAL_BASE_URI
valueFrom:
secretKeyRef:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ spec:
secretKeyRef:
name: commonurl-prod
key: FDK_BASE_URI
- name: DATASERVICE_CATALOG_BASE_URI
- name: DATA_SERVICE_CATALOG_BASE_URI
valueFrom:
secretKeyRef:
name: commonurl-prod
key: DATASERVICE_CATALOG_BASE_URI
key: DATA_SERVICE_CATALOG_BASE_URI
- name: CATALOG_PORTAL_BASE_URI
valueFrom:
secretKeyRef:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ spec:
secretKeyRef:
name: commonurl-staging
key: FDK_BASE_URI
- name: DATASERVICE_CATALOG_BASE_URI
- name: DATA_SERVICE_CATALOG_BASE_URI
valueFrom:
secretKeyRef:
name: commonurl-staging
key: DATASERVICE_CATALOG_BASE_URI
key: DATA_SERVICE_CATALOG_BASE_URI
- name: CATALOG_PORTAL_BASE_URI
valueFrom:
secretKeyRef:
Expand Down
22 changes: 17 additions & 5 deletions libs/data-access/src/lib/data-service/api/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
const path = `${process.env.DATASERVICE_CATALOG_BASE_URI}`;
const oldPath = `${process.env.DATASERVICE_CATALOG_BASE_URI}`;
const path = `${process.env.DATA_SERVICE_CATALOG_BASE_URI}`;

export const oldGetAllDataServiceCatalogs = async (accessToken: string) => {
const resource = `${oldPath}/catalogs`;
const options = {
headers: {
Authorization: `Bearer ${accessToken}`,
'Content-Type': 'application/json',
},
};
return await fetch(resource, options);
};

export const getAllDataServices = async (catalogId: string, accessToken: string) => {
const resource = `${path}/catalogs/${catalogId}/dataservices`;
const resource = `${path}/internal/catalogs/${catalogId}/data-services`;
const options = {
headers: {
Authorization: `Bearer ${accessToken}`,
Expand All @@ -13,7 +25,7 @@ export const getAllDataServices = async (catalogId: string, accessToken: string)
};

export const getDataServiceById = async (catalogId: string, dataServiceId: string, accessToken: string) => {
const resource = `${path}/catalogs/${catalogId}/dataservices/${dataServiceId}`;
const resource = `${path}/internal/catalogs/${catalogId}/data-services/${dataServiceId}`;
const options = {
headers: {
Authorization: `Bearer ${accessToken}`,
Expand All @@ -25,7 +37,7 @@ export const getDataServiceById = async (catalogId: string, dataServiceId: strin
};

export const getAllDataServiceCatalogs = async (accessToken: string) => {
const resource = `${path}/catalogs`;
const resource = `${path}/internal/catalogs/count`;
const options = {
headers: {
Authorization: `Bearer ${accessToken}`,
Expand All @@ -36,7 +48,7 @@ export const getAllDataServiceCatalogs = async (accessToken: string) => {
};

export const deleteDataService = async (catalogId: string, dataServiceId: string, accessToken: string) => {
const resource = `${path}/catalogs/${catalogId}/dataservices/${dataServiceId}`;
const resource = `${path}/internal/catalogs/${catalogId}/data-services/${dataServiceId}`;
const options = {
headers: {
Authorization: `Bearer ${accessToken}`,
Expand Down

0 comments on commit 34f63d3

Please sign in to comment.