Skip to content

Commit

Permalink
update API URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
SKarolFolio committed Nov 27, 2024
1 parent 0e1dc10 commit 76bebb4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/common/api/records.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {
BIBFRAME_API_ENDPOINT,
ExternalResourceIdType,
GET_RESOURCE_BY_TYPE_URIS,
INVENTORY_API_ENDPOINT,
MAX_LIMIT,
} from '@common/constants/api.constants';
import baseApi from './base.api';
Expand Down Expand Up @@ -32,7 +33,7 @@ export const getRecord = async ({ recordId, idType }: IGetRecord) => {
});
};

const graphIdByInventoryIdUrl = '/resource/import/:recordId';
const graphIdByInventoryIdUrl = `${INVENTORY_API_ENDPOINT}/:recordId/import`;

export const getGraphIdByExternalId = async ({ recordId }: IGetRecord) => {
const url = baseApi.generateUrl(graphIdByInventoryIdUrl, { name: ':recordId', value: recordId });
Expand Down
7 changes: 4 additions & 3 deletions src/common/constants/api.constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ export const OKAPI_CONFIG = 'okapi_config';
export const EDITOR_API_BASE_PATH = 'EDITOR_API_BASE_PATH';

// API endpoints
export const BIBFRAME_API_ENDPOINT = '/resource';
export const PROFILE_API_ENDPOINT = '/profile';
export const BIBFRAME_API_ENDPOINT = '/linked-data/resource';
export const INVENTORY_API_ENDPOINT = '/linked-data/inventory-instance'
export const PROFILE_API_ENDPOINT = '/linked-data/profile';
export const SEARCH_API_ENDPOINT = '/search/linked-data';
export const SEARCH_RESOURCE_API_ENDPOINT = `${SEARCH_API_ENDPOINT}/works`;

Expand All @@ -23,5 +24,5 @@ export enum ExternalResourceIdType {
}

export const GET_RESOURCE_BY_TYPE_URIS = {
[ExternalResourceIdType.Inventory]: `${BIBFRAME_API_ENDPOINT}/preview/:recordId`,
[ExternalResourceIdType.Inventory]: `${INVENTORY_API_ENDPOINT}/:recordId/preview`,
};

0 comments on commit 76bebb4

Please sign in to comment.