From 76bebb492b3c3d496d9261113aa23c81bd5459f7 Mon Sep 17 00:00:00 2001 From: Siarhei Karol Date: Wed, 27 Nov 2024 14:40:11 +0300 Subject: [PATCH] update API URLs --- src/common/api/records.api.ts | 3 ++- src/common/constants/api.constants.ts | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/common/api/records.api.ts b/src/common/api/records.api.ts index ddc26d26..68dbdbec 100644 --- a/src/common/api/records.api.ts +++ b/src/common/api/records.api.ts @@ -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'; @@ -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 }); diff --git a/src/common/constants/api.constants.ts b/src/common/constants/api.constants.ts index ae9a0b88..aa6b3921 100644 --- a/src/common/constants/api.constants.ts +++ b/src/common/constants/api.constants.ts @@ -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`; @@ -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`, };