Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UILD-428: update API URLs #45

Merged
merged 1 commit into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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`;
pkjacob marked this conversation as resolved.
Show resolved Hide resolved

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`,
};
Loading