diff --git a/mock/data/mockCuries.ts b/mock/data/mockCuries.ts index 63552f5b..87f3dbcd 100644 --- a/mock/data/mockCuries.ts +++ b/mock/data/mockCuries.ts @@ -3,4 +3,4 @@ export const mockCuries = () => { return [{ rdfs: "http://www.w3.org/2000/01/rdf-schema#", owl: "http://www.w3.org/2002/07/owl#" }] -} \ No newline at end of file +} diff --git a/nginx/default.conf b/nginx/default.conf index 6af93430..250a124a 100644 --- a/nginx/default.conf +++ b/nginx/default.conf @@ -102,6 +102,45 @@ server { add_header Access-Control-Allow-Credentials true always; } + location ~ ^/[^/]+/[^/]+/ontologies$ { + proxy_pass https://uri.olympiangods.org; + proxy_set_header Host uri.olympiangods.org; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_ssl_verify off; + + # CORS headers + add_header Access-Control-Allow-Origin $http_origin always; + add_header Access-Control-Allow-Credentials true always; + } + + location ~ ^/[^/]+/[^/]+/curies$ { + proxy_pass https://uri.olympiangods.org; + proxy_set_header Host uri.olympiangods.org; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_ssl_verify off; + + # CORS headers + add_header Access-Control-Allow-Origin $http_origin always; + add_header Access-Control-Allow-Credentials true always; + } + + location ~ ^/[^/]+/[^/]+/contributions$ { + proxy_pass https://uri.olympiangods.org; + proxy_set_header Host uri.olympiangods.org; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_ssl_verify off; + + # CORS headers + add_header Access-Control-Allow-Origin $http_origin always; + add_header Access-Control-Allow-Credentials true always; + } + # Handle 303 redirects for spec endpoint location @handle_303 { internal; diff --git a/src/api/endpoints/apiService.ts b/src/api/endpoints/apiService.ts index ff4f74c4..de3700d1 100644 --- a/src/api/endpoints/apiService.ts +++ b/src/api/endpoints/apiService.ts @@ -57,11 +57,31 @@ export const getOrganizations = (group: string) => { return createGetRequest(endpoint, "application/json")(); }; +export const getOrganizationsCuries = (group: string) => { + const endpoint = `/${group}${API_CONFIG.REAL_API.ORG_CURIES}`; + return createGetRequest(endpoint, "application/json")(); +}; + +export const getOrganizationsTerms = (group: string) => { + const endpoint = `/${group}${API_CONFIG.REAL_API.ORG_TERMS}`; + return createGetRequest(endpoint, "application/json")(); +}; + +export const getOrganizationsOntologies = (group: string) => { + const endpoint = `/${group}${API_CONFIG.REAL_API.ORG_ONTOLOGIES}`; + return createGetRequest(endpoint, "application/json")(); +}; + export const userLogout = (group: string) => { const endpoint = `/${group}${API_CONFIG.REAL_API.LOGOUT}`; return createGetRequest(endpoint, "application/json")(); }; +export const changePassword = (group: string, data: { username: string; currentPassword: string; newPassword: string }) => { + const endpoint = `/${group}${API_CONFIG.REAL_API.PASSWORD_CHANGE}`; + return createPostRequest(endpoint, { "Content-Type": "application/x-www-form-urlencoded" })(data); +}; + export const getSelectedTermLabel = async (searchTerm: string, group: string = 'base'): Promise<{ label: string | undefined; actualGroup: string }> => { try { const response = await createGetRequest(`/${group}/${searchTerm}.jsonld`)(); diff --git a/src/api/endpoints/index.ts b/src/api/endpoints/index.ts index 3ee1f8ee..983529f9 100644 --- a/src/api/endpoints/index.ts +++ b/src/api/endpoints/index.ts @@ -7,10 +7,9 @@ import termParser, { elasticSearchParser, getTerm } from '../../parsers/termPars import axios from 'axios'; import { API_CONFIG } from '../../config'; -const useMockApi = () => mockApi; const useApi = () => api; +const useMockApi = () => mockApi; -const BASE_GROUP = "base"; const BASE_EXTENSION = "jsonld"; export const getOrganizations = async (group) => { @@ -219,7 +218,7 @@ export const searchAll = async (term, filters = {}) => { const { searchAll } = useMockApi(); /** Call Endpoint */ - return searchAll("base", term, filters).then((data) => { + return searchAll("base", term, filters).then((data: any) => { let terms = termParser((data as any).terms, term, filters); terms?.results?.forEach( result => { result.type = TERM; @@ -244,7 +243,7 @@ export const patchTerm = async (group, termID, term) => { const {patchEndpointsIlx} = useApi(); /** Call Endpoint */ - return patchEndpointsIlx(group, termID, term).then((data) => { + return patchEndpointsIlx(group, termID, term).then((data: any) => { let termParsed = getTerm(data.data); let response = { status : data.status, @@ -291,7 +290,7 @@ export const bulkEditTerms = async (group, payload) => { const { bulkEditTerms } = useMockApi(); /** Call Endpoint */ - return bulkEditTerms(group, payload).then((data) => { + return bulkEditTerms(group, payload).then((data: any) => { let termsParsed = termParser(data.data, undefined); let response = { status : data.status, @@ -309,7 +308,7 @@ export const getEndpointsIlx = async (group, term) => { const { getEndpointsIlx } = useApi(); /** Call Endpoint */ - return getEndpointsIlx(group,term).then((data) => { + return getEndpointsIlx(group, term, BASE_EXTENSION).then((data) => { return termParser(data, term); }) .catch((error) => { @@ -414,7 +413,7 @@ export const handleLogin = async (username: string, password: string) => { }; export const handleOrcidLogin = async (code: string) => { - const response = await fetch("https://uri.olympiangods.org/u/ops/orcid-login", { + const response = await fetch(`${API_CONFIG.OLYMPIAN_GODS}/u/ops/orcid-login`, { method: "POST", headers: { "Content-Type": "application/json" }, // body: JSON.strijiuigngify({ code }), diff --git a/src/api/endpoints/interLexURIStructureAPI.ts b/src/api/endpoints/interLexURIStructureAPI.ts index 61d7feb2..36e92067 100644 --- a/src/api/endpoints/interLexURIStructureAPI.ts +++ b/src/api/endpoints/interLexURIStructureAPI.ts @@ -40,14 +40,14 @@ export const getOpsEmailVerify = ( return customInstance( - {url: `https://uri.olympiangods.org/u/ops/ever`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/u/ops/ever`, method: 'GET', signal }, options); } export const getGetOpsEmailVerifyQueryKey = () => { - return [`https://uri.olympiangods.org/u/ops/ever`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/u/ops/ever`] as const; } @@ -99,14 +99,14 @@ export const getOpsLogin = ( return customInstance( - {url: `https://uri.olympiangods.org/u/ops/login`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/u/ops/login`, method: 'GET', signal }, options); } export const getGetOpsLoginQueryKey = () => { - return [`https://uri.olympiangods.org/u/ops/login`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/u/ops/login`] as const; } @@ -155,14 +155,14 @@ export const getOpsOrcidLandingLogin = ( return customInstance( - {url: `https://uri.olympiangods.org/u/ops/orcid-land-login`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/u/ops/orcid-land-login`, method: 'GET', signal }, options); } export const getGetOpsOrcidLandingLoginQueryKey = () => { - return [`https://uri.olympiangods.org/u/ops/orcid-land-login`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/u/ops/orcid-land-login`] as const; } @@ -211,14 +211,14 @@ export const getOpsOrcidLandingNew = ( return customInstance( - {url: `https://uri.olympiangods.org/u/ops/orcid-land-new`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/u/ops/orcid-land-new`, method: 'GET', signal }, options); } export const getGetOpsOrcidLandingNewQueryKey = () => { - return [`https://uri.olympiangods.org/u/ops/orcid-land-new`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/u/ops/orcid-land-new`] as const; } @@ -267,14 +267,14 @@ export const getOpsOrcidLogin = ( return customInstance( - {url: `https://uri.olympiangods.org/u/ops/orcid-login`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/u/ops/orcid-login`, method: 'GET', signal }, options); } export const getGetOpsOrcidLoginQueryKey = () => { - return [`https://uri.olympiangods.org/u/ops/orcid-login`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/u/ops/orcid-login`] as const; } @@ -323,14 +323,14 @@ export const getOpsOrcidNew = ( return customInstance( - {url: `https://uri.olympiangods.org/u/ops/orcid-new`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/u/ops/orcid-new`, method: 'GET', signal }, options); } export const getGetOpsOrcidNewQueryKey = () => { - return [`https://uri.olympiangods.org/u/ops/orcid-new`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/u/ops/orcid-new`] as const; } @@ -379,14 +379,14 @@ export const getOpsPasswordReset = ( return customInstance( - {url: `https://uri.olympiangods.org/u/ops/pwrs`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/u/ops/pwrs`, method: 'GET', signal }, options); } export const getGetOpsPasswordResetQueryKey = () => { - return [`https://uri.olympiangods.org/u/ops/pwrs`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/u/ops/pwrs`] as const; } @@ -435,14 +435,14 @@ export const getOpsUserLogin = ( return customInstance( - {url: `https://uri.olympiangods.org/u/ops/user-login`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/u/ops/user-login`, method: 'GET', signal }, options); } export const getGetOpsUserLoginQueryKey = () => { - return [`https://uri.olympiangods.org/u/ops/user-login`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/u/ops/user-login`] as const; } @@ -490,7 +490,7 @@ export const useGetOpsUserLogin = ( -// {url: `https://uri.olympiangods.org/u/ops/user-login`, method: 'POST' +// {url: `${API_CONFIG.OLYMPIAN_GODS}/u/ops/user-login`, method: 'POST' // }, // options); // } @@ -572,14 +572,14 @@ export const getOpsUserNew = ( return customInstance( - {url: `https://uri.olympiangods.org/u/ops/user-new`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/u/ops/user-new`, method: 'GET', signal }, options); } export const getGetOpsUserNewQueryKey = () => { - return [`https://uri.olympiangods.org/u/ops/user-new`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/u/ops/user-new`] as const; } @@ -645,7 +645,7 @@ export const postOpsUserNew = ( return customInstance( - {url: `https://uri.olympiangods.org/u/ops/user-new`, method: 'POST' + {url: `${API_CONFIG.OLYMPIAN_GODS}/u/ops/user-new`, method: 'POST' }, options); } @@ -699,14 +699,14 @@ export const getOpsUserRecover = ( return customInstance( - {url: `https://uri.olympiangods.org/u/ops/user-recover`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/u/ops/user-recover`, method: 'GET', signal }, options); } export const getGetOpsUserRecoverQueryKey = () => { - return [`https://uri.olympiangods.org/u/ops/user-recover`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/u/ops/user-recover`] as const; } @@ -754,7 +754,7 @@ export const postOpsUserRecover = ( return customInstance( - {url: `https://uri.olympiangods.org/u/ops/user-recover`, method: 'POST' + {url: `${API_CONFIG.OLYMPIAN_GODS}/u/ops/user-recover`, method: 'POST' }, options); } @@ -805,14 +805,14 @@ export const getPrivuOrcidLandingAssoc = ( return customInstance( - {url: `https://uri.olympiangods.org/u/priv/orcid-land-assoc`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/u/priv/orcid-land-assoc`, method: 'GET', signal }, options); } export const getGetPrivuOrcidLandingAssocQueryKey = () => { - return [`https://uri.olympiangods.org/u/priv/orcid-land-assoc`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/u/priv/orcid-land-assoc`] as const; } @@ -861,14 +861,14 @@ export const getPrivuOrcidLandingChange = ( return customInstance( - {url: `https://uri.olympiangods.org/u/priv/orcid-land-change`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/u/priv/orcid-land-change`, method: 'GET', signal }, options); } export const getGetPrivuOrcidLandingChangeQueryKey = () => { - return [`https://uri.olympiangods.org/u/priv/orcid-land-change`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/u/priv/orcid-land-change`] as const; } @@ -917,14 +917,14 @@ export const getPrivuUserNew = ( return customInstance( - {url: `https://uri.olympiangods.org/u/priv/user-new`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/u/priv/user-new`, method: 'GET', signal }, options); } export const getGetPrivuUserNewQueryKey = () => { - return [`https://uri.olympiangods.org/u/priv/user-new`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/u/priv/user-new`] as const; } @@ -972,7 +972,7 @@ export const postPrivuUserNew = ( return customInstance( - {url: `https://uri.olympiangods.org/u/priv/user-new`, method: 'POST' + {url: `${API_CONFIG.OLYMPIAN_GODS}/u/priv/user-new`, method: 'POST' }, options); } @@ -1026,14 +1026,14 @@ export const getEndpointsGroup = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}`, method: 'GET', signal }, options); } export const getGetEndpointsGroupQueryKey = (group: string,) => { - return [`https://uri.olympiangods.org/${group}`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}`] as const; } @@ -1081,7 +1081,7 @@ export const getEndpointsContributionsExtension = ( ) => { return customInstance( { - url: `https://uri.olympiangods.org/${group}/contributions`, + url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/contributions`, method: 'GET', signal }, @@ -1090,7 +1090,7 @@ export const getEndpointsContributionsExtension = ( } export const getGetEndpointsContributionsQueryKeyExtension = (group: string,) => { - return [`https://uri.olympiangods.org/${group}/contributions`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/contributions`] as const; } export const getGetEndpointsContributionsQueryOptionsExtension = < @@ -1144,7 +1144,7 @@ export const getEndpointsContributionsExtensionInterlex = ( ) => { return customInstance( { - url: `https://uri.olympiangods.org/${group}/contributions/interlex`, + url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/contributions/interlex`, method: 'GET', signal }, @@ -1153,7 +1153,7 @@ export const getEndpointsContributionsExtensionInterlex = ( } export const getGetEndpointsContributionsQueryKeyExtensionInterlex = (group: string,) => { - return [`https://uri.olympiangods.org/${group}/contributions/interlex`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/contributions/interlex`] as const; } export const getGetEndpointsContributionsQueryOptionsExtensionInterlex = < @@ -1208,7 +1208,7 @@ export const getEndpointsCuriesExtension = ( ) => { return customInstance( { - url: `https://uri.olympiangods.org/${group}/curies`, + url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/curies`, method: 'GET', signal }, @@ -1217,7 +1217,7 @@ export const getEndpointsCuriesExtension = ( } export const getGetEndpointsCuriesQueryKeyExtension = (group: string,) => { - return [`https://uri.olympiangods.org/${group}/curies`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/curies`] as const; } export const getGetEndpointsCuriesQueryOptionsExtension = < @@ -1270,7 +1270,7 @@ export const postEndpointsCuries = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/curies`, method: 'POST' + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/curies`, method: 'POST' }, options); } @@ -1323,7 +1323,7 @@ export const getEndpointsCuries = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/curies/${prefixIriCurie}.${extension}`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/curies/${prefixIriCurie}.${extension}`, method: 'GET', signal }, options); } @@ -1332,7 +1332,7 @@ export const getEndpointsCuries = ( export const getGetEndpointsCuriesQueryKey = (group: string, prefixIriCurie: string, extension: string,) => { - return [`https://uri.olympiangods.org/${group}/curies/${prefixIriCurie}.${extension}`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/curies/${prefixIriCurie}.${extension}`] as const; } @@ -1386,7 +1386,7 @@ export const getDiffCuries = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/diff/${otherGroupDiff}/curies`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/diff/${otherGroupDiff}/curies`, method: 'GET', signal }, options); } @@ -1394,7 +1394,7 @@ export const getDiffCuries = ( export const getGetDiffCuriesQueryKey = (group: string, otherGroupDiff: string,) => { - return [`https://uri.olympiangods.org/${group}/diff/${otherGroupDiff}/curies`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/diff/${otherGroupDiff}/curies`] as const; } @@ -1445,7 +1445,7 @@ export const getDiffCuriesExtension = ( ) => { return customInstance( { - url: `https://uri.olympiangods.org/${group}/diff/${otherGroupDiff}/curies/${prefixIriCurie}.${extension}`, + url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/diff/${otherGroupDiff}/curies/${prefixIriCurie}.${extension}`, method: 'GET', signal }, @@ -1459,7 +1459,7 @@ export const getGetDiffCuriesQueryKeyExtension = ( prefixIriCurie: string, extension: string, ) => { - return [`https://uri.olympiangods.org/${group}/diff/${otherGroupDiff}/curies/${prefixIriCurie}.${extension}`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/diff/${otherGroupDiff}/curies/${prefixIriCurie}.${extension}`] as const; } export const getGetDiffCuriesQueryOptionsExtension = < @@ -1526,7 +1526,7 @@ export const getDiffLexical = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/diff/${otherGroupDiff}/lexical/${label}`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/diff/${otherGroupDiff}/lexical/${label}`, method: 'GET', signal }, options); } @@ -1535,7 +1535,7 @@ export const getDiffLexical = ( export const getGetDiffLexicalQueryKey = (group: string, otherGroupDiff: string, label: string,) => { - return [`https://uri.olympiangods.org/${group}/diff/${otherGroupDiff}/lexical/${label}`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/diff/${otherGroupDiff}/lexical/${label}`] as const; } @@ -1592,7 +1592,7 @@ export const getDiffOntologies = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/diff/${otherGroupDiff}/ontologies`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/diff/${otherGroupDiff}/ontologies`, method: 'GET', signal }, options); } @@ -1600,7 +1600,7 @@ export const getDiffOntologies = ( export const getGetDiffOntologiesQueryKey = (group: string, otherGroupDiff: string,) => { - return [`https://uri.olympiangods.org/${group}/diff/${otherGroupDiff}/ontologies`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/diff/${otherGroupDiff}/ontologies`] as const; } @@ -1658,7 +1658,7 @@ export const getDiffOntologiesContributions = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/diff/${otherGroupDiff}/ontologies/contributions`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/diff/${otherGroupDiff}/ontologies/contributions`, method: 'GET', signal }, options); } @@ -1666,7 +1666,7 @@ export const getDiffOntologiesContributions = ( export const getGetDiffOntologiesContributionsQueryKey = (group: string, otherGroupDiff: string,) => { - return [`https://uri.olympiangods.org/${group}/diff/${otherGroupDiff}/ontologies/contributions`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/diff/${otherGroupDiff}/ontologies/contributions`] as const; } @@ -1726,7 +1726,7 @@ export const getDiffOntologiesDns = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/diff/${otherGroupDiff}/ontologies/dns/${dnsHost}/${ontPath}`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/diff/${otherGroupDiff}/ontologies/dns/${dnsHost}/${ontPath}`, method: 'GET', signal }, options); } @@ -1736,7 +1736,7 @@ export const getGetDiffOntologiesDnsQueryKey = (group: string, otherGroupDiff: string, dnsHost: string, ontPath: string,) => { - return [`https://uri.olympiangods.org/${group}/diff/${otherGroupDiff}/ontologies/dns/${dnsHost}/${ontPath}`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/diff/${otherGroupDiff}/ontologies/dns/${dnsHost}/${ontPath}`] as const; } @@ -1803,7 +1803,7 @@ export const getDiffOntologiesDnsVersion = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/diff/${otherGroupDiff}/ontologies/dns/${dnsHost}/${ontPath}/version/${epochVerstrOnt}/${filenameTerminal}.${extension}`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/diff/${otherGroupDiff}/ontologies/dns/${dnsHost}/${ontPath}/version/${epochVerstrOnt}/${filenameTerminal}.${extension}`, method: 'GET', signal }, options); } @@ -1816,7 +1816,7 @@ export const getGetDiffOntologiesDnsVersionQueryKey = (group: string, epochVerstrOnt: string, filenameTerminal: string, extension: string,) => { - return [`https://uri.olympiangods.org/${group}/diff/${otherGroupDiff}/ontologies/dns/${dnsHost}/${ontPath}/version/${epochVerstrOnt}/${filenameTerminal}.${extension}`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/diff/${otherGroupDiff}/ontologies/dns/${dnsHost}/${ontPath}/version/${epochVerstrOnt}/${filenameTerminal}.${extension}`] as const; } @@ -1889,7 +1889,7 @@ export const getDiffOntologiesSpec = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/diff/${otherGroupDiff}/ontologies/${ontPath}/${filename}/version/${epochVerstrOnt}/${filenameTerminal}/spec.${extension}`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/diff/${otherGroupDiff}/ontologies/${ontPath}/${filename}/version/${epochVerstrOnt}/${filenameTerminal}/spec.${extension}`, method: 'GET', signal }, options); } @@ -1902,7 +1902,7 @@ export const getGetDiffOntologiesSpecQueryKey = (group: string, epochVerstrOnt: string, filenameTerminal: string, extension: string,) => { - return [`https://uri.olympiangods.org/${group}/diff/${otherGroupDiff}/ontologies/${ontPath}/${filename}/version/${epochVerstrOnt}/${filenameTerminal}/spec.${extension}`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/diff/${otherGroupDiff}/ontologies/${ontPath}/${filename}/version/${epochVerstrOnt}/${filenameTerminal}/spec.${extension}`] as const; } @@ -1973,7 +1973,7 @@ export const getDiffOntologiesUris = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/diff/${otherGroupDiff}/ontologies/uris/${ontPath}/${filename}.${extension}`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/diff/${otherGroupDiff}/ontologies/uris/${ontPath}/${filename}.${extension}`, method: 'GET', signal }, options); } @@ -1984,7 +1984,7 @@ export const getGetDiffOntologiesUrisQueryKey = (group: string, ontPath: string, filename: string, extension: string,) => { - return [`https://uri.olympiangods.org/${group}/diff/${otherGroupDiff}/ontologies/uris/${ontPath}/${filename}.${extension}`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/diff/${otherGroupDiff}/ontologies/uris/${ontPath}/${filename}.${extension}`] as const; } @@ -2053,7 +2053,7 @@ export const getDiffOntologiesUrisVersion = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/diff/${otherGroupDiff}/ontologies/uris/${ontPath}/${filename}/version/${epochVerstrOnt}/${filenameTerminal}.${extension}`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/diff/${otherGroupDiff}/ontologies/uris/${ontPath}/${filename}/version/${epochVerstrOnt}/${filenameTerminal}.${extension}`, method: 'GET', signal }, options); } @@ -2066,7 +2066,7 @@ export const getGetDiffOntologiesUrisVersionQueryKey = (group: string, epochVerstrOnt: string, filenameTerminal: string, extension: string,) => { - return [`https://uri.olympiangods.org/${group}/diff/${otherGroupDiff}/ontologies/uris/${ontPath}/${filename}/version/${epochVerstrOnt}/${filenameTerminal}.${extension}`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/diff/${otherGroupDiff}/ontologies/uris/${ontPath}/${filename}/version/${epochVerstrOnt}/${filenameTerminal}.${extension}`] as const; } @@ -2133,7 +2133,7 @@ export const getDiffOntologiesExtension = ( ) => { return customInstance( { - url: `https://uri.olympiangods.org/${group}/diff/${otherGroupDiff}/ontologies/${ontPath}/${filename}.${extension}`, + url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/diff/${otherGroupDiff}/ontologies/${ontPath}/${filename}.${extension}`, method: 'GET', signal }, @@ -2148,7 +2148,7 @@ export const getGetDiffOntologiesQueryKeyExtension = ( filename: string, extension: string, ) => { - return [`https://uri.olympiangods.org/${group}/diff/${otherGroupDiff}/ontologies/${ontPath}/${filename}.${extension}`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/diff/${otherGroupDiff}/ontologies/${ontPath}/${filename}.${extension}`] as const; } export const getGetDiffOntologiesQueryOptionsExtension = < @@ -2226,7 +2226,7 @@ export const getDiffOntologiesVersion = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/diff/${otherGroupDiff}/ontologies/${ontPath}/${filename}/version/${epochVerstrOnt}/${filenameTerminal}.${extension}`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/diff/${otherGroupDiff}/ontologies/${ontPath}/${filename}/version/${epochVerstrOnt}/${filenameTerminal}.${extension}`, method: 'GET', signal }, options); } @@ -2239,7 +2239,7 @@ export const getGetDiffOntologiesVersionQueryKey = (group: string, epochVerstrOnt: string, filenameTerminal: string, extension: string,) => { - return [`https://uri.olympiangods.org/${group}/diff/${otherGroupDiff}/ontologies/${ontPath}/${filename}/version/${epochVerstrOnt}/${filenameTerminal}.${extension}`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/diff/${otherGroupDiff}/ontologies/${ontPath}/${filename}/version/${epochVerstrOnt}/${filenameTerminal}.${extension}`] as const; } @@ -2306,7 +2306,7 @@ export const getDiffOntologiesIlx = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/diff/${otherGroupDiff}/ontologies/${fragPrefId}.${extension}`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/diff/${otherGroupDiff}/ontologies/${fragPrefId}.${extension}`, method: 'GET', signal }, options); } @@ -2316,7 +2316,7 @@ export const getGetDiffOntologiesIlxQueryKey = (group: string, otherGroupDiff: string, fragPrefId: string, extension: string,) => { - return [`https://uri.olympiangods.org/${group}/diff/${otherGroupDiff}/ontologies/${fragPrefId}.${extension}`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/diff/${otherGroupDiff}/ontologies/${fragPrefId}.${extension}`] as const; } @@ -2377,7 +2377,7 @@ export const getDiffOntologiesIlxSpec = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/diff/${otherGroupDiff}/ontologies/${fragPrefId}/spec.${extension}`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/diff/${otherGroupDiff}/ontologies/${fragPrefId}/spec.${extension}`, method: 'GET', signal }, options); } @@ -2387,7 +2387,7 @@ export const getGetDiffOntologiesIlxSpecQueryKey = (group: string, otherGroupDiff: string, fragPrefId: string, extension: string,) => { - return [`https://uri.olympiangods.org/${group}/diff/${otherGroupDiff}/ontologies/${fragPrefId}/spec.${extension}`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/diff/${otherGroupDiff}/ontologies/${fragPrefId}/spec.${extension}`] as const; } @@ -2447,7 +2447,7 @@ export const getDiffReadable = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/diff/${otherGroupDiff}/readable/${word}`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/diff/${otherGroupDiff}/readable/${word}`, method: 'GET', signal }, options); } @@ -2456,7 +2456,7 @@ export const getDiffReadable = ( export const getGetDiffReadableQueryKey = (group: string, otherGroupDiff: string, word: string,) => { - return [`https://uri.olympiangods.org/${group}/diff/${otherGroupDiff}/readable/${word}`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/diff/${otherGroupDiff}/readable/${word}`] as const; } @@ -2511,7 +2511,7 @@ export const getDiffUris = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/diff/${otherGroupDiff}/uris/${uriPath}`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/diff/${otherGroupDiff}/uris/${uriPath}`, method: 'GET', signal }, options); } @@ -2520,7 +2520,7 @@ export const getDiffUris = ( export const getGetDiffUrisQueryKey = (group: string, otherGroupDiff: string, uriPath: string,) => { - return [`https://uri.olympiangods.org/${group}/diff/${otherGroupDiff}/uris/${uriPath}`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/diff/${otherGroupDiff}/uris/${uriPath}`] as const; } @@ -2575,7 +2575,7 @@ export const getDiffVersionsCuries = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/diff/${otherGroupDiff}/versions/${epochVerstrId}/curies`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/diff/${otherGroupDiff}/versions/${epochVerstrId}/curies`, method: 'GET', signal }, options); } @@ -2584,7 +2584,7 @@ export const getDiffVersionsCuries = ( export const getGetDiffVersionsCuriesQueryKey = (group: string, otherGroupDiff: string, epochVerstrId: string,) => { - return [`https://uri.olympiangods.org/${group}/diff/${otherGroupDiff}/versions/${epochVerstrId}/curies`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/diff/${otherGroupDiff}/versions/${epochVerstrId}/curies`] as const; } @@ -2637,7 +2637,7 @@ export const getDiffVersionsCuriesExtension = ( ) => { return customInstance( { - url: `https://uri.olympiangods.org/${group}/diff/${otherGroupDiff}/versions/${epochVerstrId}/curies/${prefixIriCurie}.${extension}`, + url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/diff/${otherGroupDiff}/versions/${epochVerstrId}/curies/${prefixIriCurie}.${extension}`, method: 'GET', signal }, @@ -2652,7 +2652,7 @@ export const getGetDiffVersionsCuriesQueryKeyExtension = ( prefixIriCurie: string, extension: string, ) => { - return [`https://uri.olympiangods.org/${group}/diff/${otherGroupDiff}/versions/${epochVerstrId}/curies/${prefixIriCurie}.${extension}`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/diff/${otherGroupDiff}/versions/${epochVerstrId}/curies/${prefixIriCurie}.${extension}`] as const; } export const getGetDiffVersionsCuriesQueryOptionsExtension = < @@ -2724,7 +2724,7 @@ export const getDiffVersionsReadable = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/diff/${otherGroupDiff}/versions/${epochVerstrId}/readable/${word}`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/diff/${otherGroupDiff}/versions/${epochVerstrId}/readable/${word}`, method: 'GET', signal }, options); } @@ -2734,7 +2734,7 @@ export const getGetDiffVersionsReadableQueryKey = (group: string, otherGroupDiff: string, epochVerstrId: string, word: string,) => { - return [`https://uri.olympiangods.org/${group}/diff/${otherGroupDiff}/versions/${epochVerstrId}/readable/${word}`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/diff/${otherGroupDiff}/versions/${epochVerstrId}/readable/${word}`] as const; } @@ -2792,7 +2792,7 @@ export const getDiffVersionsUris = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/diff/${otherGroupDiff}/versions/${epochVerstrId}/uris/${uriPath}`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/diff/${otherGroupDiff}/versions/${epochVerstrId}/uris/${uriPath}`, method: 'GET', signal }, options); } @@ -2802,7 +2802,7 @@ export const getGetDiffVersionsUrisQueryKey = (group: string, otherGroupDiff: string, epochVerstrId: string, uriPath: string,) => { - return [`https://uri.olympiangods.org/${group}/diff/${otherGroupDiff}/versions/${epochVerstrId}/uris/${uriPath}`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/diff/${otherGroupDiff}/versions/${epochVerstrId}/uris/${uriPath}`] as const; } @@ -2860,7 +2860,7 @@ export const getDiffVersionsIlx = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/diff/${otherGroupDiff}/versions/${epochVerstrId}/${fragPrefId}`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/diff/${otherGroupDiff}/versions/${epochVerstrId}/${fragPrefId}`, method: 'GET', signal }, options); } @@ -2870,7 +2870,7 @@ export const getGetDiffVersionsIlxQueryKey = (group: string, otherGroupDiff: string, epochVerstrId: string, fragPrefId: string,) => { - return [`https://uri.olympiangods.org/${group}/diff/${otherGroupDiff}/versions/${epochVerstrId}/${fragPrefId}`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/diff/${otherGroupDiff}/versions/${epochVerstrId}/${fragPrefId}`] as const; } @@ -2928,7 +2928,7 @@ export const getDiffVersionsOther = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/diff/${otherGroupDiff}/versions/${epochVerstrId}/${fragPrefId}/other`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/diff/${otherGroupDiff}/versions/${epochVerstrId}/${fragPrefId}/other`, method: 'GET', signal }, options); } @@ -2938,7 +2938,7 @@ export const getGetDiffVersionsOtherQueryKey = (group: string, otherGroupDiff: string, epochVerstrId: string, fragPrefId: string,) => { - return [`https://uri.olympiangods.org/${group}/diff/${otherGroupDiff}/versions/${epochVerstrId}/${fragPrefId}/other`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/diff/${otherGroupDiff}/versions/${epochVerstrId}/${fragPrefId}/other`] as const; } @@ -2996,7 +2996,7 @@ export const getDiffVersionsVersions = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/diff/${otherGroupDiff}/versions/${epochVerstrId}/${fragPrefId}/versions`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/diff/${otherGroupDiff}/versions/${epochVerstrId}/${fragPrefId}/versions`, method: 'GET', signal }, options); } @@ -3006,7 +3006,7 @@ export const getGetDiffVersionsVersionsQueryKey = (group: string, otherGroupDiff: string, epochVerstrId: string, fragPrefId: string,) => { - return [`https://uri.olympiangods.org/${group}/diff/${otherGroupDiff}/versions/${epochVerstrId}/${fragPrefId}/versions`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/diff/${otherGroupDiff}/versions/${epochVerstrId}/${fragPrefId}/versions`] as const; } @@ -3063,7 +3063,7 @@ export const getDiffIlx = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/diff/${otherGroupDiff}/${fragPrefId}`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/diff/${otherGroupDiff}/${fragPrefId}`, method: 'GET', signal }, options); } @@ -3072,7 +3072,7 @@ export const getDiffIlx = ( export const getGetDiffIlxQueryKey = (group: string, otherGroupDiff: string, fragPrefId: string,) => { - return [`https://uri.olympiangods.org/${group}/diff/${otherGroupDiff}/${fragPrefId}`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/diff/${otherGroupDiff}/${fragPrefId}`] as const; } @@ -3127,7 +3127,7 @@ export const getDiffOther = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/diff/${otherGroupDiff}/${fragPrefId}/other`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/diff/${otherGroupDiff}/${fragPrefId}/other`, method: 'GET', signal }, options); } @@ -3136,7 +3136,7 @@ export const getDiffOther = ( export const getGetDiffOtherQueryKey = (group: string, otherGroupDiff: string, fragPrefId: string,) => { - return [`https://uri.olympiangods.org/${group}/diff/${otherGroupDiff}/${fragPrefId}/other`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/diff/${otherGroupDiff}/${fragPrefId}/other`] as const; } @@ -3191,7 +3191,7 @@ export const getDiffVersions = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/diff/${otherGroupDiff}/${fragPrefId}/versions`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/diff/${otherGroupDiff}/${fragPrefId}/versions`, method: 'GET', signal }, options); } @@ -3200,7 +3200,7 @@ export const getDiffVersions = ( export const getGetDiffVersionsQueryKey = (group: string, otherGroupDiff: string, fragPrefId: string,) => { - return [`https://uri.olympiangods.org/${group}/diff/${otherGroupDiff}/${fragPrefId}/versions`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/diff/${otherGroupDiff}/${fragPrefId}/versions`] as const; } @@ -3253,14 +3253,14 @@ export const getEndpointsMapped = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/external/mapped`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/external/mapped`, method: 'GET', signal }, options); } export const getGetEndpointsMappedQueryKey = (group: string,) => { - return [`https://uri.olympiangods.org/${group}/external/mapped`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/external/mapped`] as const; } @@ -3308,7 +3308,7 @@ export const postEndpointsMapped = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/external/mapped`, method: 'POST' + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/external/mapped`, method: 'POST' }, options); } @@ -3360,7 +3360,7 @@ export const getEndpointsLexical = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/lexical/${label}`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/lexical/${label}`, method: 'GET', signal }, options); } @@ -3368,7 +3368,7 @@ export const getEndpointsLexical = ( export const getGetEndpointsLexicalQueryKey = (group: string, label: string,) => { - return [`https://uri.olympiangods.org/${group}/lexical/${label}`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/lexical/${label}`] as const; } @@ -3422,14 +3422,14 @@ export const getEndpointsOntologies = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/ontologies`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/ontologies`, method: 'GET', signal }, options); } export const getGetEndpointsOntologiesQueryKey = (group: string,) => { - return [`https://uri.olympiangods.org/${group}/ontologies`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/ontologies`] as const; } @@ -3484,14 +3484,14 @@ export const getOntologiesOntologiesContributions = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/ontologies/contributions`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/ontologies/contributions`, method: 'GET', signal }, options); } export const getGetOntologiesOntologiesContributionsQueryKey = (group: string,) => { - return [`https://uri.olympiangods.org/${group}/ontologies/contributions`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/ontologies/contributions`] as const; } @@ -3548,7 +3548,7 @@ export const getOntologiesOntologiesDns = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/ontologies/dns/${dnsHost}/${ontPath}`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/ontologies/dns/${dnsHost}/${ontPath}`, method: 'GET', signal }, options); } @@ -3557,7 +3557,7 @@ export const getOntologiesOntologiesDns = ( export const getGetOntologiesOntologiesDnsQueryKey = (group: string, dnsHost: string, ontPath: string,) => { - return [`https://uri.olympiangods.org/${group}/ontologies/dns/${dnsHost}/${ontPath}`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/ontologies/dns/${dnsHost}/${ontPath}`] as const; } @@ -3621,7 +3621,7 @@ export const getOntologiesOntologiesDnsVersion = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/ontologies/dns/${dnsHost}/${ontPath}/version/${epochVerstrOnt}/${filenameTerminal}.${extension}`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/ontologies/dns/${dnsHost}/${ontPath}/version/${epochVerstrOnt}/${filenameTerminal}.${extension}`, method: 'GET', signal }, options); } @@ -3633,7 +3633,7 @@ export const getGetOntologiesOntologiesDnsVersionQueryKey = (group: string, epochVerstrOnt: string, filenameTerminal: string, extension: string,) => { - return [`https://uri.olympiangods.org/${group}/ontologies/dns/${dnsHost}/${ontPath}/version/${epochVerstrOnt}/${filenameTerminal}.${extension}`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/ontologies/dns/${dnsHost}/${ontPath}/version/${epochVerstrOnt}/${filenameTerminal}.${extension}`] as const; } @@ -3702,7 +3702,7 @@ export const postOntologiesOntologiesDnsVersion = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/ontologies/dns/${dnsHost}/${ontPath}/version/${epochVerstrOnt}/${filenameTerminal}.${extension}`, method: 'POST' + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/ontologies/dns/${dnsHost}/${ontPath}/version/${epochVerstrOnt}/${filenameTerminal}.${extension}`, method: 'POST' }, options); } @@ -3764,7 +3764,7 @@ export const getOntologiesOntologiesSpec = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/ontologies/${ontPath}/${filename}/version/${epochVerstrOnt}/${filenameTerminal}/spec.${extension}`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/ontologies/${ontPath}/${filename}/version/${epochVerstrOnt}/${filenameTerminal}/spec.${extension}`, method: 'GET', signal }, options); } @@ -3776,7 +3776,7 @@ export const getGetOntologiesOntologiesSpecQueryKey = (group: string, epochVerstrOnt: string, filenameTerminal: string, extension: string,) => { - return [`https://uri.olympiangods.org/${group}/ontologies/${ontPath}/${filename}/version/${epochVerstrOnt}/${filenameTerminal}/spec.${extension}`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/ontologies/${ontPath}/${filename}/version/${epochVerstrOnt}/${filenameTerminal}/spec.${extension}`] as const; } @@ -3845,7 +3845,7 @@ export const postOntologiesOntologiesSpec = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/ontologies/uris/${ontPath}/${filename}/version/${epochVerstrOnt}/${filenameTerminal}/spec.${extension}`, method: 'POST' + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/ontologies/uris/${ontPath}/${filename}/version/${epochVerstrOnt}/${filenameTerminal}/spec.${extension}`, method: 'POST' }, options); } @@ -3906,7 +3906,7 @@ export const patchOntologiesOntologiesSpec = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/ontologies/uris/${ontPath}/${filename}/version/${epochVerstrOnt}/${filenameTerminal}/spec.${extension}`, method: 'PATCH' + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/ontologies/uris/${ontPath}/${filename}/version/${epochVerstrOnt}/${filenameTerminal}/spec.${extension}`, method: 'PATCH' }, options); } @@ -3966,7 +3966,7 @@ export const getOntologiesOntologiesUris = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/ontologies/uris/${ontPath}/${filename}.${extension}`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/ontologies/uris/${ontPath}/${filename}.${extension}`, method: 'GET', signal }, options); } @@ -3976,7 +3976,7 @@ export const getGetOntologiesOntologiesUrisQueryKey = (group: string, ontPath: string, filename: string, extension: string,) => { - return [`https://uri.olympiangods.org/${group}/ontologies/uris/${ontPath}/${filename}.${extension}`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/ontologies/uris/${ontPath}/${filename}.${extension}`] as const; } @@ -4039,7 +4039,7 @@ export const postOntologiesOntologiesUris = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/ontologies/uris/${ontPath}/${filename}.${extension}`, method: 'POST' + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/ontologies/uris/${ontPath}/${filename}.${extension}`, method: 'POST' }, options); } @@ -4101,7 +4101,7 @@ export const getOntologiesOntologiesUrisVersion = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/ontologies/uris/${ontPath}/${filename}/version/${epochVerstrOnt}/${filenameTerminal}.${extension}`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/ontologies/uris/${ontPath}/${filename}/version/${epochVerstrOnt}/${filenameTerminal}.${extension}`, method: 'GET', signal }, options); } @@ -4113,7 +4113,7 @@ export const getGetOntologiesOntologiesUrisVersionQueryKey = (group: string, epochVerstrOnt: string, filenameTerminal: string, extension: string,) => { - return [`https://uri.olympiangods.org/${group}/ontologies/uris/${ontPath}/${filename}/version/${epochVerstrOnt}/${filenameTerminal}.${extension}`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/ontologies/uris/${ontPath}/${filename}/version/${epochVerstrOnt}/${filenameTerminal}.${extension}`] as const; } @@ -4182,7 +4182,7 @@ export const postOntologiesOntologiesUrisVersion = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/ontologies/uris/${ontPath}/${filename}/version/${epochVerstrOnt}/${filenameTerminal}.${extension}`, method: 'POST' + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/ontologies/uris/${ontPath}/${filename}/version/${epochVerstrOnt}/${filenameTerminal}.${extension}`, method: 'POST' }, options); } @@ -4242,7 +4242,7 @@ export const getOntologiesOntologies = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/ontologies/${ontPath}/${filename}.${extension}`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/ontologies/${ontPath}/${filename}.${extension}`, method: 'GET', signal }, options); } @@ -4252,7 +4252,7 @@ export const getGetOntologiesOntologiesQueryKey = (group: string, ontPath: string, filename: string, extension: string,) => { - return [`https://uri.olympiangods.org/${group}/ontologies/${ontPath}/${filename}.${extension}`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/ontologies/${ontPath}/${filename}.${extension}`] as const; } @@ -4315,7 +4315,7 @@ export const postOntologiesOntologies = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/ontologies/${ontPath}/${filename}.${extension}`, method: 'POST' + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/ontologies/${ontPath}/${filename}.${extension}`, method: 'POST' }, options); } @@ -4377,7 +4377,7 @@ export const getOntologiesOntologiesVersion = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/ontologies/${ontPath}/${filename}/version/${epochVerstrOnt}/${filenameTerminal}.${extension}`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/ontologies/${ontPath}/${filename}/version/${epochVerstrOnt}/${filenameTerminal}.${extension}`, method: 'GET', signal }, options); } @@ -4389,7 +4389,7 @@ export const getGetOntologiesOntologiesVersionQueryKey = (group: string, epochVerstrOnt: string, filenameTerminal: string, extension: string,) => { - return [`https://uri.olympiangods.org/${group}/ontologies/${ontPath}/${filename}/version/${epochVerstrOnt}/${filenameTerminal}.${extension}`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/ontologies/${ontPath}/${filename}/version/${epochVerstrOnt}/${filenameTerminal}.${extension}`] as const; } @@ -4453,7 +4453,7 @@ export const getOntologiesOntologiesIlx = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/ontologies/${fragPrefId}.${extension}`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/ontologies/${fragPrefId}.${extension}`, method: 'GET', signal }, options); } @@ -4462,7 +4462,7 @@ export const getOntologiesOntologiesIlx = ( export const getGetOntologiesOntologiesIlxQueryKey = (group: string, fragPrefId: string, extension: string,) => { - return [`https://uri.olympiangods.org/${group}/ontologies/${fragPrefId}.${extension}`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/ontologies/${fragPrefId}.${extension}`] as const; } @@ -4520,7 +4520,7 @@ export const getOntologiesOntologiesIlxSpec = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/ontologies/${fragPrefId}/spec.${extension}`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/ontologies/${fragPrefId}/spec.${extension}`, method: 'GET', signal }, options); } @@ -4529,7 +4529,7 @@ export const getOntologiesOntologiesIlxSpec = ( export const getGetOntologiesOntologiesIlxSpecQueryKey = (group: string, fragPrefId: string, extension: string,) => { - return [`https://uri.olympiangods.org/${group}/ontologies/${fragPrefId}/spec.${extension}`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/ontologies/${fragPrefId}/spec.${extension}`] as const; } @@ -4589,7 +4589,7 @@ export const postOntologiesOntologiesIlxSpec = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/ontologies/${fragPrefId}/spec.${extension}`, method: 'POST' + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/ontologies/${fragPrefId}/spec.${extension}`, method: 'POST' }, options); } @@ -4647,7 +4647,7 @@ export const patchOntologiesOntologiesIlxSpec = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/ontologies/${fragPrefId}/spec.${extension}`, method: 'PATCH' + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/ontologies/${fragPrefId}/spec.${extension}`, method: 'PATCH' }, options); } @@ -4702,7 +4702,7 @@ export const getOwnCuries = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/own/${otherGroup}/curies`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/own/${otherGroup}/curies`, method: 'GET', signal }, options); } @@ -4710,7 +4710,7 @@ export const getOwnCuries = ( export const getGetOwnCuriesQueryKey = (group: string, otherGroup: string,) => { - return [`https://uri.olympiangods.org/${group}/own/${otherGroup}/curies`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/own/${otherGroup}/curies`] as const; } @@ -4761,7 +4761,7 @@ export const postOwnCuries = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/own/${otherGroup}/curies`, method: 'POST' + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/own/${otherGroup}/curies`, method: 'POST' }, options); } @@ -4815,7 +4815,7 @@ export const getOwnCuriesExtension = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/own/${otherGroup}/curies/${prefixIriCurie}.${extension}`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/own/${otherGroup}/curies/${prefixIriCurie}.${extension}`, method: 'GET', signal }, options); } @@ -4825,7 +4825,7 @@ export const getGetOwnCuriesQueryKeyExtension = (group: string, otherGroup: string, prefixIriCurie: string, extension: string,) => { - return [`https://uri.olympiangods.org/${group}/own/${otherGroup}/curies/${prefixIriCurie}.${extension}`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/own/${otherGroup}/curies/${prefixIriCurie}.${extension}`] as const; } @@ -4884,7 +4884,7 @@ export const getOwnOntologies = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/own/${otherGroup}/ontologies`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/own/${otherGroup}/ontologies`, method: 'GET', signal }, options); } @@ -4892,7 +4892,7 @@ export const getOwnOntologies = ( export const getGetOwnOntologiesQueryKey = (group: string, otherGroup: string,) => { - return [`https://uri.olympiangods.org/${group}/own/${otherGroup}/ontologies`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/own/${otherGroup}/ontologies`] as const; } @@ -4950,7 +4950,7 @@ export const getOwnOntologiesContributions = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/own/${otherGroup}/ontologies/contributions`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/own/${otherGroup}/ontologies/contributions`, method: 'GET', signal }, options); } @@ -4958,7 +4958,7 @@ export const getOwnOntologiesContributions = ( export const getGetOwnOntologiesContributionsQueryKey = (group: string, otherGroup: string,) => { - return [`https://uri.olympiangods.org/${group}/own/${otherGroup}/ontologies/contributions`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/own/${otherGroup}/ontologies/contributions`] as const; } @@ -5018,7 +5018,7 @@ export const getOwnOntologiesDns = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/own/${otherGroup}/ontologies/dns/${dnsHost}/${ontPath}`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/own/${otherGroup}/ontologies/dns/${dnsHost}/${ontPath}`, method: 'GET', signal }, options); } @@ -5028,7 +5028,7 @@ export const getGetOwnOntologiesDnsQueryKey = (group: string, otherGroup: string, dnsHost: string, ontPath: string,) => { - return [`https://uri.olympiangods.org/${group}/own/${otherGroup}/ontologies/dns/${dnsHost}/${ontPath}`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/own/${otherGroup}/ontologies/dns/${dnsHost}/${ontPath}`] as const; } @@ -5095,7 +5095,7 @@ export const getOwnOntologiesDnsVersion = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/own/${otherGroup}/ontologies/dns/${dnsHost}/${ontPath}/version/${epochVerstrOnt}/${filenameTerminal}.${extension}`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/own/${otherGroup}/ontologies/dns/${dnsHost}/${ontPath}/version/${epochVerstrOnt}/${filenameTerminal}.${extension}`, method: 'GET', signal }, options); } @@ -5108,7 +5108,7 @@ export const getGetOwnOntologiesDnsVersionQueryKey = (group: string, epochVerstrOnt: string, filenameTerminal: string, extension: string,) => { - return [`https://uri.olympiangods.org/${group}/own/${otherGroup}/ontologies/dns/${dnsHost}/${ontPath}/version/${epochVerstrOnt}/${filenameTerminal}.${extension}`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/own/${otherGroup}/ontologies/dns/${dnsHost}/${ontPath}/version/${epochVerstrOnt}/${filenameTerminal}.${extension}`] as const; } @@ -5180,7 +5180,7 @@ export const postOwnOntologiesDnsVersion = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/own/${otherGroup}/ontologies/dns/${dnsHost}/${ontPath}/version/${epochVerstrOnt}/${filenameTerminal}.${extension}`, method: 'POST' + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/own/${otherGroup}/ontologies/dns/${dnsHost}/${ontPath}/version/${epochVerstrOnt}/${filenameTerminal}.${extension}`, method: 'POST' }, options); } @@ -5243,7 +5243,7 @@ export const getOwnOntologiesSpec = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/own/${otherGroup}/ontologies/${ontPath}/${filename}/version/${epochVerstrOnt}/${filenameTerminal}/spec.${extension}`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/own/${otherGroup}/ontologies/${ontPath}/${filename}/version/${epochVerstrOnt}/${filenameTerminal}/spec.${extension}`, method: 'GET', signal }, options); } @@ -5256,7 +5256,7 @@ export const getGetOwnOntologiesSpecQueryKey = (group: string, epochVerstrOnt: string, filenameTerminal: string, extension: string,) => { - return [`https://uri.olympiangods.org/${group}/own/${otherGroup}/ontologies/${ontPath}/${filename}/version/${epochVerstrOnt}/${filenameTerminal}/spec.${extension}`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/own/${otherGroup}/ontologies/${ontPath}/${filename}/version/${epochVerstrOnt}/${filenameTerminal}/spec.${extension}`] as const; } @@ -5328,7 +5328,7 @@ export const postOwnOntologiesSpec = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/own/${otherGroup}/ontologies/uris/${ontPath}/${filename}/version/${epochVerstrOnt}/${filenameTerminal}/spec.${extension}`, method: 'POST' + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/own/${otherGroup}/ontologies/uris/${ontPath}/${filename}/version/${epochVerstrOnt}/${filenameTerminal}/spec.${extension}`, method: 'POST' }, options); } @@ -5390,7 +5390,7 @@ export const patchOwnOntologiesSpec = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/own/${otherGroup}/ontologies/uris/${ontPath}/${filename}/version/${epochVerstrOnt}/${filenameTerminal}/spec.${extension}`, method: 'PATCH' + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/own/${otherGroup}/ontologies/uris/${ontPath}/${filename}/version/${epochVerstrOnt}/${filenameTerminal}/spec.${extension}`, method: 'PATCH' }, options); } @@ -5451,7 +5451,7 @@ export const getOwnOntologiesUris = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/own/${otherGroup}/ontologies/uris/${ontPath}/${filename}.${extension}`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/own/${otherGroup}/ontologies/uris/${ontPath}/${filename}.${extension}`, method: 'GET', signal }, options); } @@ -5462,7 +5462,7 @@ export const getGetOwnOntologiesUrisQueryKey = (group: string, ontPath: string, filename: string, extension: string,) => { - return [`https://uri.olympiangods.org/${group}/own/${otherGroup}/ontologies/uris/${ontPath}/${filename}.${extension}`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/own/${otherGroup}/ontologies/uris/${ontPath}/${filename}.${extension}`] as const; } @@ -5528,7 +5528,7 @@ export const postOwnOntologiesUris = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/own/${otherGroup}/ontologies/uris/${ontPath}/${filename}.${extension}`, method: 'POST' + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/own/${otherGroup}/ontologies/uris/${ontPath}/${filename}.${extension}`, method: 'POST' }, options); } @@ -5591,7 +5591,7 @@ export const getOwnOntologiesUrisVersion = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/own/${otherGroup}/ontologies/uris/${ontPath}/${filename}/version/${epochVerstrOnt}/${filenameTerminal}.${extension}`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/own/${otherGroup}/ontologies/uris/${ontPath}/${filename}/version/${epochVerstrOnt}/${filenameTerminal}.${extension}`, method: 'GET', signal }, options); } @@ -5604,7 +5604,7 @@ export const getGetOwnOntologiesUrisVersionQueryKey = (group: string, epochVerstrOnt: string, filenameTerminal: string, extension: string,) => { - return [`https://uri.olympiangods.org/${group}/own/${otherGroup}/ontologies/uris/${ontPath}/${filename}/version/${epochVerstrOnt}/${filenameTerminal}.${extension}`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/own/${otherGroup}/ontologies/uris/${ontPath}/${filename}/version/${epochVerstrOnt}/${filenameTerminal}.${extension}`] as const; } @@ -5676,7 +5676,7 @@ export const postOwnOntologiesUrisVersion = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/own/${otherGroup}/ontologies/uris/${ontPath}/${filename}/version/${epochVerstrOnt}/${filenameTerminal}.${extension}`, method: 'POST' + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/own/${otherGroup}/ontologies/uris/${ontPath}/${filename}/version/${epochVerstrOnt}/${filenameTerminal}.${extension}`, method: 'POST' }, options); } @@ -5735,7 +5735,7 @@ export const getOwnOntologiesExtension = ( ) => { return customInstance( { - url: `https://uri.olympiangods.org/${group}/own/${otherGroup}/ontologies/${ontPath}/${filename}.${extension}`, + url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/own/${otherGroup}/ontologies/${ontPath}/${filename}.${extension}`, method: 'GET', signal }, @@ -5750,7 +5750,7 @@ export const getGetOwnOntologiesQueryKeyExtension = ( filename: string, extension: string, ) => { - return [`https://uri.olympiangods.org/${group}/own/${otherGroup}/ontologies/${ontPath}/${filename}.${extension}`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/own/${otherGroup}/ontologies/${ontPath}/${filename}.${extension}`] as const; } export const getGetOwnOntologiesQueryOptionsExtension = < @@ -5827,7 +5827,7 @@ export const postOwnOntologies = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/own/${otherGroup}/ontologies/${ontPath}/${filename}.${extension}`, method: 'POST' + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/own/${otherGroup}/ontologies/${ontPath}/${filename}.${extension}`, method: 'POST' }, options); } @@ -5890,7 +5890,7 @@ export const getOwnOntologiesVersion = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/own/${otherGroup}/ontologies/${ontPath}/${filename}/version/${epochVerstrOnt}/${filenameTerminal}.${extension}`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/own/${otherGroup}/ontologies/${ontPath}/${filename}/version/${epochVerstrOnt}/${filenameTerminal}.${extension}`, method: 'GET', signal }, options); } @@ -5903,7 +5903,7 @@ export const getGetOwnOntologiesVersionQueryKey = (group: string, epochVerstrOnt: string, filenameTerminal: string, extension: string,) => { - return [`https://uri.olympiangods.org/${group}/own/${otherGroup}/ontologies/${ontPath}/${filename}/version/${epochVerstrOnt}/${filenameTerminal}.${extension}`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/own/${otherGroup}/ontologies/${ontPath}/${filename}/version/${epochVerstrOnt}/${filenameTerminal}.${extension}`] as const; } @@ -5970,7 +5970,7 @@ export const getOwnOntologiesIlx = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/own/${otherGroup}/ontologies/${fragPrefId}.${extension}`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/own/${otherGroup}/ontologies/${fragPrefId}.${extension}`, method: 'GET', signal }, options); } @@ -5980,7 +5980,7 @@ export const getGetOwnOntologiesIlxQueryKey = (group: string, otherGroup: string, fragPrefId: string, extension: string,) => { - return [`https://uri.olympiangods.org/${group}/own/${otherGroup}/ontologies/${fragPrefId}.${extension}`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/own/${otherGroup}/ontologies/${fragPrefId}.${extension}`] as const; } @@ -6041,7 +6041,7 @@ export const getOwnOntologiesIlxSpec = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/own/${otherGroup}/ontologies/${fragPrefId}/spec.${extension}`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/own/${otherGroup}/ontologies/${fragPrefId}/spec.${extension}`, method: 'GET', signal }, options); } @@ -6051,7 +6051,7 @@ export const getGetOwnOntologiesIlxSpecQueryKey = (group: string, otherGroup: string, fragPrefId: string, extension: string,) => { - return [`https://uri.olympiangods.org/${group}/own/${otherGroup}/ontologies/${fragPrefId}/spec.${extension}`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/own/${otherGroup}/ontologies/${fragPrefId}/spec.${extension}`] as const; } @@ -6114,7 +6114,7 @@ export const postOwnOntologiesIlxSpec = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/own/${otherGroup}/ontologies/${fragPrefId}/spec.${extension}`, method: 'POST' + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/own/${otherGroup}/ontologies/${fragPrefId}/spec.${extension}`, method: 'POST' }, options); } @@ -6173,7 +6173,7 @@ export const patchOwnOntologiesIlxSpec = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/own/${otherGroup}/ontologies/${fragPrefId}/spec.${extension}`, method: 'PATCH' + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/own/${otherGroup}/ontologies/${fragPrefId}/spec.${extension}`, method: 'PATCH' }, options); } @@ -6229,7 +6229,7 @@ export const getOwnUris = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/own/${otherGroup}/uris/${uriPath}`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/own/${otherGroup}/uris/${uriPath}`, method: 'GET', signal }, options); } @@ -6238,7 +6238,7 @@ export const getOwnUris = ( export const getGetOwnUrisQueryKey = (group: string, otherGroup: string, uriPath: string,) => { - return [`https://uri.olympiangods.org/${group}/own/${otherGroup}/uris/${uriPath}`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/own/${otherGroup}/uris/${uriPath}`] as const; } @@ -6293,7 +6293,7 @@ export const getOwnVersionsCuries = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/own/${otherGroup}/versions/${epochVerstrId}/curies`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/own/${otherGroup}/versions/${epochVerstrId}/curies`, method: 'GET', signal }, options); } @@ -6302,7 +6302,7 @@ export const getOwnVersionsCuries = ( export const getGetOwnVersionsCuriesQueryKey = (group: string, otherGroup: string, epochVerstrId: string,) => { - return [`https://uri.olympiangods.org/${group}/own/${otherGroup}/versions/${epochVerstrId}/curies`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/own/${otherGroup}/versions/${epochVerstrId}/curies`] as const; } @@ -6355,7 +6355,7 @@ export const getOwnVersionsCuriesExtension = ( ) => { return customInstance( { - url: `https://uri.olympiangods.org/${group}/own/${otherGroup}/versions/${epochVerstrId}/curies/${prefixIriCurie}.${extension}`, + url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/own/${otherGroup}/versions/${epochVerstrId}/curies/${prefixIriCurie}.${extension}`, method: 'GET', signal }, @@ -6370,7 +6370,7 @@ export const getGetOwnVersionsCuriesQueryKeyExtension = ( prefixIriCurie: string, extension: string, ) => { - return [`https://uri.olympiangods.org/${group}/own/${otherGroup}/versions/${epochVerstrId}/curies/${prefixIriCurie}.${extension}`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/own/${otherGroup}/versions/${epochVerstrId}/curies/${prefixIriCurie}.${extension}`] as const; } export const getGetOwnVersionsCuriesQueryOptionsExtension = < @@ -6439,7 +6439,7 @@ export const getOwnVersionsReadable = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/own/${otherGroup}/versions/${epochVerstrId}/readable/${word}`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/own/${otherGroup}/versions/${epochVerstrId}/readable/${word}`, method: 'GET', signal }, options); } @@ -6449,7 +6449,7 @@ export const getGetOwnVersionsReadableQueryKey = (group: string, otherGroup: string, epochVerstrId: string, word: string,) => { - return [`https://uri.olympiangods.org/${group}/own/${otherGroup}/versions/${epochVerstrId}/readable/${word}`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/own/${otherGroup}/versions/${epochVerstrId}/readable/${word}`] as const; } @@ -6507,7 +6507,7 @@ export const getOwnVersionsUris = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/own/${otherGroup}/versions/${epochVerstrId}/uris/${uriPath}`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/own/${otherGroup}/versions/${epochVerstrId}/uris/${uriPath}`, method: 'GET', signal }, options); } @@ -6517,7 +6517,7 @@ export const getGetOwnVersionsUrisQueryKey = (group: string, otherGroup: string, epochVerstrId: string, uriPath: string,) => { - return [`https://uri.olympiangods.org/${group}/own/${otherGroup}/versions/${epochVerstrId}/uris/${uriPath}`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/own/${otherGroup}/versions/${epochVerstrId}/uris/${uriPath}`] as const; } @@ -6575,7 +6575,7 @@ export const getOwnVersionsIlx = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/own/${otherGroup}/versions/${epochVerstrId}/${fragPrefId}`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/own/${otherGroup}/versions/${epochVerstrId}/${fragPrefId}`, method: 'GET', signal }, options); } @@ -6585,7 +6585,7 @@ export const getGetOwnVersionsIlxQueryKey = (group: string, otherGroup: string, epochVerstrId: string, fragPrefId: string,) => { - return [`https://uri.olympiangods.org/${group}/own/${otherGroup}/versions/${epochVerstrId}/${fragPrefId}`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/own/${otherGroup}/versions/${epochVerstrId}/${fragPrefId}`] as const; } @@ -6643,7 +6643,7 @@ export const getOwnVersionsOther = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/own/${otherGroup}/versions/${epochVerstrId}/${fragPrefId}/other`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/own/${otherGroup}/versions/${epochVerstrId}/${fragPrefId}/other`, method: 'GET', signal }, options); } @@ -6653,7 +6653,7 @@ export const getGetOwnVersionsOtherQueryKey = (group: string, otherGroup: string, epochVerstrId: string, fragPrefId: string,) => { - return [`https://uri.olympiangods.org/${group}/own/${otherGroup}/versions/${epochVerstrId}/${fragPrefId}/other`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/own/${otherGroup}/versions/${epochVerstrId}/${fragPrefId}/other`] as const; } @@ -6711,7 +6711,7 @@ export const getOwnVersionsVersions = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/own/${otherGroup}/versions/${epochVerstrId}/${fragPrefId}/versions`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/own/${otherGroup}/versions/${epochVerstrId}/${fragPrefId}/versions`, method: 'GET', signal }, options); } @@ -6721,7 +6721,7 @@ export const getGetOwnVersionsVersionsQueryKey = (group: string, otherGroup: string, epochVerstrId: string, fragPrefId: string,) => { - return [`https://uri.olympiangods.org/${group}/own/${otherGroup}/versions/${epochVerstrId}/${fragPrefId}/versions`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/own/${otherGroup}/versions/${epochVerstrId}/${fragPrefId}/versions`] as const; } @@ -6776,14 +6776,14 @@ export const getPrivApiTokenNew = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/priv/api-token-new`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/priv/api-token-new`, method: 'GET', signal }, options); } export const getGetPrivApiTokenNewQueryKey = (group: string,) => { - return [`https://uri.olympiangods.org/${group}/priv/api-token-new`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/priv/api-token-new`] as const; } @@ -6831,7 +6831,7 @@ export const postPrivApiTokenNew = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/priv/api-token-new`, method: 'POST' + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/priv/api-token-new`, method: 'POST' }, options); } @@ -6882,14 +6882,14 @@ export const getPrivApiTokenRevoke = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/priv/api-token-revoke`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/priv/api-token-revoke`, method: 'GET', signal }, options); } export const getGetPrivApiTokenRevokeQueryKey = (group: string,) => { - return [`https://uri.olympiangods.org/${group}/priv/api-token-revoke`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/priv/api-token-revoke`] as const; } @@ -6937,7 +6937,7 @@ export const putPrivApiTokenRevoke = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/priv/api-token-revoke`, method: 'PUT' + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/priv/api-token-revoke`, method: 'PUT' }, options); } @@ -6988,14 +6988,14 @@ export const getPrivApiTokens = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/priv/api-tokens`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/priv/api-tokens`, method: 'GET', signal }, options); } export const getGetPrivApiTokensQueryKey = (group: string,) => { - return [`https://uri.olympiangods.org/${group}/priv/api-tokens`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/priv/api-tokens`] as const; } @@ -7044,14 +7044,14 @@ export const getPrivCommitteeNew = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/priv/committee-new`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/priv/committee-new`, method: 'GET', signal }, options); } export const getGetPrivCommitteeNewQueryKey = (group: string,) => { - return [`https://uri.olympiangods.org/${group}/priv/committee-new`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/priv/committee-new`] as const; } @@ -7100,14 +7100,14 @@ export const getPrivCuration = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/priv/curation`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/priv/curation`, method: 'GET', signal }, options); } export const getGetPrivCurationQueryKey = (group: string,) => { - return [`https://uri.olympiangods.org/${group}/priv/curation`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/priv/curation`] as const; } @@ -7156,14 +7156,14 @@ export const getPrivEmailAdd = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/priv/email-add`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/priv/email-add`, method: 'GET', signal }, options); } export const getGetPrivEmailAddQueryKey = (group: string,) => { - return [`https://uri.olympiangods.org/${group}/priv/email-add`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/priv/email-add`] as const; } @@ -7211,7 +7211,7 @@ export const postPrivEmailAdd = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/priv/email-add`, method: 'POST' + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/priv/email-add`, method: 'POST' }, options); } @@ -7261,7 +7261,7 @@ export const postPrivEmailDel = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/priv/email-del`, method: 'POST' + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/priv/email-del`, method: 'POST' }, options); } @@ -7311,7 +7311,7 @@ export const postPrivEmailPrimary = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/priv/email-primary`, method: 'POST' + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/priv/email-primary`, method: 'POST' }, options); } @@ -7362,14 +7362,14 @@ export const getPrivEmailVerify = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/priv/email-verify`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/priv/email-verify`, method: 'GET', signal }, options); } export const getGetPrivEmailVerifyQueryKey = (group: string,) => { - return [`https://uri.olympiangods.org/${group}/priv/email-verify`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/priv/email-verify`] as const; } @@ -7465,14 +7465,14 @@ export const getPrivEntityNew = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/priv/entity-new`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/priv/entity-new`, method: 'GET', signal }, options); } export const getGetPrivEntityNewQueryKey = (group: string,) => { - return [`https://uri.olympiangods.org/${group}/priv/entity-new`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/priv/entity-new`] as const; } @@ -7571,7 +7571,7 @@ export const postPrivEntityNew = ( ) => { return customInstance( { - url: `https://uri.olympiangods.org/${group}/priv/entity-new`, + url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/priv/entity-new`, method: 'POST', data, headers: options?.headers, @@ -7629,14 +7629,14 @@ export const getPrivLogout = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/priv/logout`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/priv/logout`, method: 'GET', signal }, options); } export const getGetPrivLogoutQueryKey = (group: string,) => { - return [`https://uri.olympiangods.org/${group}/priv/logout`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/priv/logout`] as const; } @@ -7684,7 +7684,7 @@ export const patchPrivModifyAB = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/priv/modify-a-b`, method: 'PATCH' + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/priv/modify-a-b`, method: 'PATCH' }, options); } @@ -7734,7 +7734,7 @@ export const patchPrivModifyAddRem = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/priv/modify-add-rem`, method: 'PATCH' + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/priv/modify-add-rem`, method: 'PATCH' }, options); } @@ -7785,14 +7785,14 @@ export const getPrivOrcidAssociate = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/priv/orcid-assoc`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/priv/orcid-assoc`, method: 'GET', signal }, options); } export const getGetPrivOrcidAssociateQueryKey = (group: string,) => { - return [`https://uri.olympiangods.org/${group}/priv/orcid-assoc`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/priv/orcid-assoc`] as const; } @@ -7840,7 +7840,7 @@ export const postPrivOrcidChange = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/priv/orcid-change`, method: 'POST' + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/priv/orcid-change`, method: 'POST' }, options); } @@ -7890,7 +7890,7 @@ export const postPrivOrcidDissociate = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/priv/orcid-dissoc`, method: 'POST' + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/priv/orcid-dissoc`, method: 'POST' }, options); } @@ -7940,7 +7940,7 @@ export const postPrivOrgNew = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/priv/org-new`, method: 'POST' + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/priv/org-new`, method: 'POST' }, options); } @@ -7990,7 +7990,7 @@ export const postPrivPasswordChange = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/priv/password-change`, method: 'POST' + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/priv/password-change`, method: 'POST' }, options); } @@ -8041,14 +8041,14 @@ export const getPrivPullNew = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/priv/pull-new`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/priv/pull-new`, method: 'GET', signal }, options); } export const getGetPrivPullNewQueryKey = (group: string,) => { - return [`https://uri.olympiangods.org/${group}/priv/pull-new`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/priv/pull-new`] as const; } @@ -8096,7 +8096,7 @@ export const postPrivRequestIngest = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/priv/request-ingest`, method: 'POST' + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/priv/request-ingest`, method: 'POST' }, options); } @@ -8147,14 +8147,14 @@ export const getPrivUserRole = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/priv/role`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/priv/role`, method: 'GET', signal }, options); } export const getGetPrivUserRoleQueryKey = (group: string,) => { - return [`https://uri.olympiangods.org/${group}/priv/role`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/priv/role`] as const; } @@ -8200,14 +8200,14 @@ export const getPrivRoleOtherGroup = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/priv/role-other`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/priv/role-other`, method: 'GET', signal }, options); } export const getGetPrivRoleOtherGroupQueryKey = (group: string,) => { - return [`https://uri.olympiangods.org/${group}/priv/role-other`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/priv/role-other`] as const; } @@ -8253,7 +8253,7 @@ export const getPrivRoleOtherGroupOther = ( ) => { return customInstance( { - url: `https://uri.olympiangods.org/${group}/priv/role-other/${otherRoleGroup}`, + url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/priv/role-other/${otherRoleGroup}`, method: 'GET', signal }, @@ -8265,7 +8265,7 @@ export const getGetPrivRoleOtherGroupQueryKeyOther = ( group: string, otherRoleGroup: string, ) => { - return [`https://uri.olympiangods.org/${group}/priv/role-other/${otherRoleGroup}`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/priv/role-other/${otherRoleGroup}`] as const; } export const getGetPrivRoleOtherGroupQueryOptionsOther = < @@ -8325,7 +8325,7 @@ export const deletePrivRoleOtherGroup = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/priv/role-other/${otherRoleGroup}`, method: 'DELETE' + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/priv/role-other/${otherRoleGroup}`, method: 'DELETE' }, options); } @@ -8376,7 +8376,7 @@ const {mutation: mutationOptions, request: requestOptions} = options ?? {}; ) => { return customInstance( { - url: `https://uri.olympiangods.org/${group}/priv/role/${user}`, + url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/priv/role/${user}`, method: 'GET', signal }, @@ -8388,7 +8388,7 @@ const {mutation: mutationOptions, request: requestOptions} = options ?? {}; group: string, user: string, ) => { - return [`https://uri.olympiangods.org/${group}/priv/role/${user}`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/priv/role/${user}`] as const; } export const getGetPrivUserRoleQueryOptionsUser = < @@ -8448,7 +8448,7 @@ export const deletePrivUserRole = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/priv/role/${user}`, method: 'DELETE' + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/priv/role/${user}`, method: 'DELETE' }, options); } @@ -8499,7 +8499,7 @@ export const putPrivUserRole = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/priv/role/${user}`, method: 'PUT' + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/priv/role/${user}`, method: 'PUT' }, options); } @@ -8550,14 +8550,14 @@ export const getPrivSettings = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/priv/settings`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/priv/settings`, method: 'GET', signal }, options); } export const getGetPrivSettingsQueryKey = (group: string,) => { - return [`https://uri.olympiangods.org/${group}/priv/settings`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/priv/settings`] as const; } @@ -8608,7 +8608,7 @@ export const postPrivUpload = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/priv/upload`, method: 'POST' + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/priv/upload`, method: 'POST' }, options); } @@ -8661,7 +8661,7 @@ export const postPrivUserDeactivate = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/priv/user-deactivate`, method: 'POST' + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/priv/user-deactivate`, method: 'POST' }, options); } @@ -8718,7 +8718,7 @@ export const getEndpointsProv = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/prov/identities/${identity}`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/prov/identities/${identity}`, method: 'GET', signal }, options); } @@ -8726,7 +8726,7 @@ export const getEndpointsProv = ( export const getGetEndpointsProvQueryKey = (group: string, identity: string,) => { - return [`https://uri.olympiangods.org/${group}/prov/identities/${identity}`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/prov/identities/${identity}`] as const; } @@ -8780,14 +8780,14 @@ export const getPullsPulls = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/pulls`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/pulls`, method: 'GET', signal }, options); } export const getGetPullsPullsQueryKey = (group: string,) => { - return [`https://uri.olympiangods.org/${group}/pulls`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/pulls`] as const; } @@ -8837,7 +8837,7 @@ export const getPullsPull = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/pulls/${pull}/review`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/pulls/${pull}/review`, method: 'GET', signal }, options); } @@ -8845,7 +8845,7 @@ export const getPullsPull = ( export const getGetPullsPullQueryKey = (group: string, pull: string,) => { - return [`https://uri.olympiangods.org/${group}/pulls/${pull}/review`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/pulls/${pull}/review`] as const; } @@ -8896,7 +8896,7 @@ export const postPullsClose = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/pulls/${pull}/ops/close`, method: 'POST' + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/pulls/${pull}/ops/close`, method: 'POST' }, options); } @@ -8947,7 +8947,7 @@ export const postPullsLock = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/pulls/${pull}/ops/lock`, method: 'POST' + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/pulls/${pull}/ops/lock`, method: 'POST' }, options); } @@ -8998,7 +8998,7 @@ export const postPullsMerge = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/pulls/${pull}/ops/merge`, method: 'POST' + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/pulls/${pull}/ops/merge`, method: 'POST' }, options); } @@ -9049,7 +9049,7 @@ export const postPullsReopen = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/pulls/${pull}/ops/reopen`, method: 'POST' + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/pulls/${pull}/ops/reopen`, method: 'POST' }, options); } @@ -9101,7 +9101,7 @@ export const getEndpointsReadable = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/readable/${word}`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/readable/${word}`, method: 'GET', signal }, options); } @@ -9109,7 +9109,7 @@ export const getEndpointsReadable = ( export const getGetEndpointsReadableQueryKey = (group: string, word: string,) => { - return [`https://uri.olympiangods.org/${group}/readable/${word}`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/readable/${word}`] as const; } @@ -9160,7 +9160,7 @@ export const patchEndpointsReadable = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/readable/${word}`, method: 'PATCH' + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/readable/${word}`, method: 'PATCH' }, options); } @@ -9212,7 +9212,7 @@ export const getEndpointsUris = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/uris/${uriPath}`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/uris/${uriPath}`, method: 'GET', signal }, options); } @@ -9220,7 +9220,7 @@ export const getEndpointsUris = ( export const getGetEndpointsUrisQueryKey = (group: string, uriPath: string,) => { - return [`https://uri.olympiangods.org/${group}/uris/${uriPath}`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/uris/${uriPath}`] as const; } @@ -9272,7 +9272,7 @@ export const getVersionsCuries = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/versions/${epochVerstrId}/curies`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/versions/${epochVerstrId}/curies`, method: 'GET', signal }, options); } @@ -9280,7 +9280,7 @@ export const getVersionsCuries = ( export const getGetVersionsCuriesQueryKey = (group: string, epochVerstrId: string,) => { - return [`https://uri.olympiangods.org/${group}/versions/${epochVerstrId}/curies`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/versions/${epochVerstrId}/curies`] as const; } @@ -9330,7 +9330,7 @@ export const getVersionsCuriesExtension = ( ) => { return customInstance( { - url: `https://uri.olympiangods.org/${group}/versions/${epochVerstrId}/curies/${prefixIriCurie}.${extension}`, + url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/versions/${epochVerstrId}/curies/${prefixIriCurie}.${extension}`, method: 'GET', signal }, @@ -9344,7 +9344,7 @@ export const getGetVersionsCuriesQueryKeyExtension = ( prefixIriCurie: string, extension: string, ) => { - return [`https://uri.olympiangods.org/${group}/versions/${epochVerstrId}/curies/${prefixIriCurie}.${extension}`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/versions/${epochVerstrId}/curies/${prefixIriCurie}.${extension}`] as const; } export const getGetVersionsCuriesQueryOptionsExtension = < @@ -9412,7 +9412,7 @@ export const getVersionsReadable = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/versions/${epochVerstrId}/readable/${word}`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/versions/${epochVerstrId}/readable/${word}`, method: 'GET', signal }, options); } @@ -9421,7 +9421,7 @@ export const getVersionsReadable = ( export const getGetVersionsReadableQueryKey = (group: string, epochVerstrId: string, word: string,) => { - return [`https://uri.olympiangods.org/${group}/versions/${epochVerstrId}/readable/${word}`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/versions/${epochVerstrId}/readable/${word}`] as const; } @@ -9476,7 +9476,7 @@ export const getVersionsUris = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/versions/${epochVerstrId}/uris/${uriPath}`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/versions/${epochVerstrId}/uris/${uriPath}`, method: 'GET', signal }, options); } @@ -9485,7 +9485,7 @@ export const getVersionsUris = ( export const getGetVersionsUrisQueryKey = (group: string, epochVerstrId: string, uriPath: string,) => { - return [`https://uri.olympiangods.org/${group}/versions/${epochVerstrId}/uris/${uriPath}`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/versions/${epochVerstrId}/uris/${uriPath}`] as const; } @@ -9540,7 +9540,7 @@ export const getVersionsIlx = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/versions/${epochVerstrId}/${fragPrefId}`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/versions/${epochVerstrId}/${fragPrefId}`, method: 'GET', signal }, options); } @@ -9549,7 +9549,7 @@ export const getVersionsIlx = ( export const getGetVersionsIlxQueryKey = (group: string, epochVerstrId: string, fragPrefId: string,) => { - return [`https://uri.olympiangods.org/${group}/versions/${epochVerstrId}/${fragPrefId}`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/versions/${epochVerstrId}/${fragPrefId}`] as const; } @@ -9604,7 +9604,7 @@ export const getVersionsOther = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/versions/${epochVerstrId}/${fragPrefId}/other`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/versions/${epochVerstrId}/${fragPrefId}/other`, method: 'GET', signal }, options); } @@ -9613,7 +9613,7 @@ export const getVersionsOther = ( export const getGetVersionsOtherQueryKey = (group: string, epochVerstrId: string, fragPrefId: string,) => { - return [`https://uri.olympiangods.org/${group}/versions/${epochVerstrId}/${fragPrefId}/other`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/versions/${epochVerstrId}/${fragPrefId}/other`] as const; } @@ -9668,7 +9668,7 @@ export const getVersionsVersions = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/versions/${epochVerstrId}/${fragPrefId}/versions`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/versions/${epochVerstrId}/${fragPrefId}/versions`, method: 'GET', signal }, options); } @@ -9677,7 +9677,7 @@ export const getVersionsVersions = ( export const getGetVersionsVersionsQueryKey = (group: string, epochVerstrId: string, fragPrefId: string,) => { - return [`https://uri.olympiangods.org/${group}/versions/${epochVerstrId}/${fragPrefId}/versions`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/versions/${epochVerstrId}/${fragPrefId}/versions`] as const; } @@ -9741,7 +9741,7 @@ export const getEndpointsIlx = ( export const getGetEndpointsIlxQueryKey = (group: string, fragPrefId: string, extension: string,) => { - return [`https://uri.olympiangods.org/${group}/${fragPrefId}.${extension}`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/${fragPrefId}.${extension}`] as const; } @@ -9794,7 +9794,7 @@ export const patchEndpointsIlx = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/${fragPrefId}`, method: 'PATCH' + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/${fragPrefId}`, method: 'PATCH' }, options); } @@ -9846,7 +9846,7 @@ export const getEndpointsOther = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/${fragPrefId}/other`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/${fragPrefId}/other`, method: 'GET', signal }, options); } @@ -9854,7 +9854,7 @@ export const getEndpointsOther = ( export const getGetEndpointsOtherQueryKey = (group: string, fragPrefId: string,) => { - return [`https://uri.olympiangods.org/${group}/${fragPrefId}/other`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/${fragPrefId}/other`] as const; } @@ -9906,7 +9906,7 @@ export const getEndpointsVersions = ( return customInstance( - {url: `https://uri.olympiangods.org/${group}/${fragPrefId}/versions`, method: 'GET', signal + {url: `${API_CONFIG.OLYMPIAN_GODS}/${group}/${fragPrefId}/versions`, method: 'GET', signal }, options); } @@ -9914,7 +9914,7 @@ export const getEndpointsVersions = ( export const getGetEndpointsVersionsQueryKey = (group: string, fragPrefId: string,) => { - return [`https://uri.olympiangods.org/${group}/${fragPrefId}/versions`] as const; + return [`${API_CONFIG.OLYMPIAN_GODS}/${group}/${fragPrefId}/versions`] as const; } @@ -9954,7 +9954,3 @@ export const useGetEndpointsVersions = ((() => ({ status: 200, @@ -1870,7 +1871,7 @@ export const getGetOrganizationsTermsResponseMock = () => ((() => [ } ])()) -export const getGetOrganizationsOntologiesResponseMock = () => ((() => [{ +export const getGetOrganizationsOntologiesResponseMock = () => [{ name: "Test Ontology 1", description: "This file imports all the bridging modules that are relating NIF-Cell with other NIF modules", id: "nif-neuron-bridge-test1", @@ -1900,7 +1901,7 @@ export const getGetOrganizationsOntologiesResponseMock = () => ((() => [{ id: "nif-neuron-bridge-test5", version_info: "0.1; May 9th, 2012", url: "http://ontology.neuinfo.org/NIF/ttl/unused/NIF-Neuron-Bridge.ttl" -}])()) +}]; export const getGetOrganizationsCuriesResponseMock = () => ((() => { return [{ @@ -3913,7 +3914,7 @@ export const getGetVariantsResponseMock = () => ((() => [ "userID": "olivia", "userName": "Oliviya Rhye" }, - "url": "https://uri.olympiangods.org/base/ilx_0101901.jsonld" + "url": `${API_CONFIG.OLYMPIAN_GODS}/base/ilx_0101901.jsonld` }, { "id": "variant_ilx_0101431", @@ -3929,7 +3930,7 @@ export const getGetVariantsResponseMock = () => ((() => [ "userID": "olivia", "userName": "Oliviya Rhye" }, - "url": "https://uri.olympiangods.org/base/ilx_0101431.jsonld" + "url": `${API_CONFIG.OLYMPIAN_GODS}/base/ilx_0101431.jsonld` } ])()) @@ -4006,7 +4007,7 @@ export const getGetVersionsResponseMock = () => ((() => [ "id": "version_ilx_0101901", "fork": { "name": "ForkPB-2", - "url": "https://uri.olympiangods.org/base/versions/ilx_0101901" + "url": `${API_CONFIG.OLYMPIAN_GODS}/base/versions/ilx_0101901` }, "action": "Merge", "lastModifyBy": "24 March 12:08am", @@ -4210,9 +4211,21 @@ export const getGetUserForksMockHandler = (overrideResponse?: Forks) => { } export const getGetOrganizationMockHandler = (overrideResponse?: Organization) => { - return http.get('*/operations/getOrganization/:id', async () => { + return http.get('*/operations/getOrganization/:id', async ({ params }) => { await delay(1000); - return new HttpResponse(JSON.stringify(overrideResponse !== undefined ? overrideResponse : getGetOrganizationResponseMock()), + const { id } = params; + const originalMock = getGetOrganizationResponseMock(); + const isRealOrganization = typeof id === 'string' && id !== originalMock.name; + + const mockResponse = overrideResponse !== undefined ? overrideResponse : { + ...originalMock, + name: typeof id === 'string' ? id : originalMock.name, + description: isRealOrganization ? '' : originalMock.description, // Empty description for real organizations + id: isRealOrganization ? '' : originalMock.id, + url: isRealOrganization ? '' : originalMock.url, + icon: isRealOrganization ? '' : originalMock.icon + }; + return new HttpResponse(JSON.stringify(mockResponse), { status: 200, headers: { @@ -4252,9 +4265,16 @@ export const getGetOrganizationsMockHandler = (overrideResponse?: Organizations) } export const getGetOrganizationsTermsMockHandler = (overrideResponse?: Terms) => { - return http.get('*/operations/getOrganization/:organization/terms', async () => { + return http.get('*/operations/getOrganization/:organization/terms', async ({ params }) => { await delay(1000); - return new HttpResponse(JSON.stringify(overrideResponse !== undefined ? overrideResponse : getGetOrganizationsTermsResponseMock()), + const { organization } = params; + const isRealOrganization = typeof organization === 'string' && organization !== 'SPARC Anatomical Working Group'; + + const mockResponse = overrideResponse !== undefined ? overrideResponse : ( + isRealOrganization ? [] : getGetOrganizationsTermsResponseMock() + ); + + return new HttpResponse(JSON.stringify(mockResponse), { status: 200, headers: { @@ -4266,9 +4286,18 @@ export const getGetOrganizationsTermsMockHandler = (overrideResponse?: Terms) => } export const getGetOrganizationsOntologiesMockHandler = (overrideResponse?: Ontologies) => { - return http.get('*/operations/getOrganization/:organization/ontologies', async () => { + return http.get('*/:organization/ontologies', async ({ params }) => { await delay(1000); - return new HttpResponse(JSON.stringify(overrideResponse !== undefined ? overrideResponse : getGetOrganizationsOntologiesResponseMock()), + const { organization } = params; + console.log('MSW: Handling ontologies request for organization:', organization); + + const mockResponse = overrideResponse !== undefined ? overrideResponse : ( + getGetOrganizationsOntologiesResponseMock() + ); + + console.log('MSW: Returning ontologies mock response:', mockResponse); + + return new HttpResponse(JSON.stringify(mockResponse), { status: 200, headers: { @@ -4280,9 +4309,16 @@ export const getGetOrganizationsOntologiesMockHandler = (overrideResponse?: Onto } export const getGetOrganizationsCuriesMockHandler = (overrideResponse?: Curies) => { - return http.get('*/operations/getOrganization/:organization/curies', async () => { + return http.get('*/operations/getOrganization/:organization/curies', async ({ params }) => { await delay(1000); - return new HttpResponse(JSON.stringify(overrideResponse !== undefined ? overrideResponse : getGetOrganizationsCuriesResponseMock()), + const { organization } = params; + const isRealOrganization = typeof organization === 'string' && organization !== 'SPARC Anatomical Working Group'; + + const mockResponse = overrideResponse !== undefined ? overrideResponse : ( + isRealOrganization ? {} : getGetOrganizationsCuriesResponseMock() + ); + + return new HttpResponse(JSON.stringify(mockResponse), { status: 200, headers: { diff --git a/src/components/CurieEditor/OrganizationCurieEditor.jsx b/src/components/CurieEditor/OrganizationCurieEditor.jsx index 759c6f8d..27269f0f 100644 --- a/src/components/CurieEditor/OrganizationCurieEditor.jsx +++ b/src/components/CurieEditor/OrganizationCurieEditor.jsx @@ -5,13 +5,17 @@ import { useCallback } from "react"; import debounce from 'lodash/debounce'; +import { useParams, useNavigate } from "react-router-dom"; import { EditNoteIcon } from "../../Icons"; +import ArrowBackIcon from '@mui/icons-material/ArrowBack'; import BasicTabs from "../common/CustomTabs"; import CuriesTabPanel from "./CuriesTabPanel"; import CustomButton from "../common/CustomButton"; import OntologyTabPanel from "./OntologyTabPanel"; import CurieEditorDialog from "./CurieEditorDialog"; -import { getOrganizationCuries } from "../../api/endpoints"; +// TODO: This API endpoint may return 501 (Not Implemented) errors +// Updated to use real API service instead of mock data with proper error handling +import { getOrganizationsCuries } from "../../api/endpoints/apiService"; import CustomSingleSelect from "../common/CustomSingleSelect"; import { Box, Typography, Divider, Grid, Stack } from "@mui/material"; @@ -25,9 +29,10 @@ const generatePageOptions = (curieAmount) => { }; const newRowObj = { prefix: '', namespace: '' }; -const curiesTabs = ["Organization", "Ontologies"]; +const curiesTabs = ["Curies", "Ontologies"]; const OrganizationsCurieEditor = () => { + const navigate = useNavigate(); const [loading, setLoading] = useState(true); // eslint-disable-next-line no-unused-vars const [error, setError] = useState(null); @@ -38,15 +43,48 @@ const OrganizationsCurieEditor = () => { const [openCurieEditor, setOpenCurieEditor] = useState(false); const [pageOptions, setPageOptions] = useState([]); + const { title } = useParams(); // Get organization name from URL params + const getOrganizationRequest = useCallback(async (id) => { - await getOrganizationCuries(id).then((response) => { - console.log("Get Organization curies response ", response) - setCuries(response) - setCurieAmount(response.length) + try { + const response = await getOrganizationsCuries(id); + + // Handle both array and object response formats + let curiesObject; + if (Array.isArray(response) && response.length > 0) { + // If response is an array, take the first item + curiesObject = response[0]; + } else if (response && typeof response === 'object') { + // If response is a direct object, use it directly + curiesObject = response; + } + + if (curiesObject && Object.keys(curiesObject).length > 0) { + // Convert object to array of {prefix, namespace} objects + const curiesArray = Object.entries(curiesObject).map(([prefix, namespace]) => ({ + prefix, + namespace + })); + setCuries(curiesArray); + setCurieAmount(curiesArray.length); + } else { + setCuries([]); + setCurieAmount(0); + } setLoading(false); - }).catch((error) => { - console.log("Error ", error) - }); + } catch (error) { + // TODO: Handle when backend curies endpoint is fully implemented + if (error?.response?.status === 501) { + console.warn("Organization curies endpoint not implemented yet (501), using empty array"); + setCuries([]); + setCurieAmount(0); + } else { + console.error("Error fetching curies data", error); + setCuries([]); + setCurieAmount(0); + } + setLoading(false); + } }, [setCuries, setCurieAmount, setLoading]); // eslint-disable-next-line no-unused-vars @@ -80,14 +118,17 @@ const OrganizationsCurieEditor = () => { const handleClickCurieEditor = () => setOpenCurieEditor(true); const handleCloseCurieEditor = () => setOpenCurieEditor(false); const handleChangeTabs = (event, newValue) => setTabValue(newValue); + const handleBackToOrganization = () => navigate(`/organizations/${title}`); const handleSubmit = () => { console.log("POST: here connect to post method") } useEffect(() => { - getOrganizationRequest("1"); - }, [getOrganizationRequest]); + if (title) { + getOrganizationRequest(title); + } + }, [getOrganizationRequest, title]); useEffect(() => { const options = generatePageOptions(curieAmount); @@ -114,6 +155,11 @@ const OrganizationsCurieEditor = () => { Edit curies + + + + Back to Organization + diff --git a/src/components/Dashboard/TermsChange/index.jsx b/src/components/Dashboard/TermsChange/index.jsx index e5cca0c9..ef62c7eb 100644 --- a/src/components/Dashboard/TermsChange/index.jsx +++ b/src/components/Dashboard/TermsChange/index.jsx @@ -25,13 +25,19 @@ const TermsChange = () => { }; const getFilteredEntries = () => { + // Ensure forks is an array before filtering + if (!Array.isArray(forks)) { + console.warn('forks is not an array:', forks); + return []; + } + switch (tabValue) { case 0: - return forks?.filter(entry => entry.status === "requested"); + return forks.filter(entry => entry.status === "requested"); case 1: - return forks?.filter(entry => entry.status === "approved"); + return forks.filter(entry => entry.status === "approved"); case 2: - return forks?.filter(entry => entry.status === "rejected"); + return forks.filter(entry => entry.status === "rejected"); default: return forks; } @@ -42,11 +48,19 @@ const TermsChange = () => { // eslint-disable-next-line react-hooks/exhaustive-deps const fetchForks = useCallback( debounce(async () => { - getUserForks("123").then(data => { - setForks(data) - }).catch(err => { - console.log(err); - }) + try { + const data = await getUserForks("123"); + // Ensure we always set an array + if (Array.isArray(data)) { + setForks(data); + } else { + console.warn('getUserForks returned non-array data:', data); + setForks([]); + } + } catch (err) { + console.error('Error fetching forks:', err); + setForks([]); // Set empty array on error - will show "no data" message + } }, 500), [getUserForks] ); diff --git a/src/components/Dashboard/User/AccountSettingsDialog.jsx b/src/components/Dashboard/User/AccountSettingsDialog.jsx index abca8238..8b2493a3 100644 --- a/src/components/Dashboard/User/AccountSettingsDialog.jsx +++ b/src/components/Dashboard/User/AccountSettingsDialog.jsx @@ -1,12 +1,14 @@ import PropTypes from "prop-types"; -import { useState } from "react"; -import { Box, Divider, Button, Typography, Avatar, Stack, Grid, TextField, Link } from "@mui/material"; +import { useState, useContext } from "react"; +import { Box, Divider, Button, Typography, Avatar, Stack, Grid, TextField, Link, Snackbar } from "@mui/material"; import CustomizedDialog from "../../common/CustomizedDialog"; import PasswordField from "./PasswordField"; import PersonOutlineIcon from '@mui/icons-material/PersonOutline'; import ModeEditOutlineOutlinedIcon from "@mui/icons-material/ModeEditOutlineOutlined"; import SaveOutlinedIcon from '@mui/icons-material/SaveOutlined'; import ArrowForwardIcon from '@mui/icons-material/ArrowForward'; +import { GlobalDataContext } from "../../../contexts/DataContext"; +import { changePassword } from "../../../api/endpoints/apiService"; import { vars } from "../../../theme/variables"; const { gray600, gray700, brand700 } = vars; @@ -32,7 +34,11 @@ const AccountSettingsDialog = ({ open, handleClose }) => { + const { user: contextUser } = useContext(GlobalDataContext); const [showPasswordField, setShowPasswordField] = useState(false); + const [snackbarOpen, setSnackbarOpen] = useState(false); + const [snackbarMessage, setSnackbarMessage] = useState(""); + const [isSubmitting, setIsSubmitting] = useState(false); const [formData, setFormData] = useState({ email: user?.email, currentPassword: "", @@ -47,13 +53,63 @@ const AccountSettingsDialog = ({ })) } - const handleSubmit = (e) => { - e.preventDefault() - console.log("Form submitted:", formData) + const handleSubmit = async (e) => { + e.preventDefault(); + + if (!showPasswordField) { + return; + } + + // Validate passwords match + if (formData.newPassword !== formData.confirmPassword) { + setSnackbarMessage("New passwords do not match"); + setSnackbarOpen(true); + return; + } + + setIsSubmitting(true); + + try { + const groupname = (contextUser || user)?.groupname; + if (!groupname) { + throw new Error("No groupname available"); + } + + await changePassword(groupname, { + username: (contextUser || user)?.name || (contextUser || user)?.groupname, + currentPassword: formData.currentPassword, + newPassword: formData.newPassword, + }); + + setSnackbarMessage("Password changed successfully"); + setSnackbarOpen(true); + setShowPasswordField(false); + setFormData(prev => ({ + ...prev, + currentPassword: "", + newPassword: "", + confirmPassword: "", + })); + } catch (error) { + console.error("Password change error:", error); + + // Check if it's a 501 error (not implemented) + if (error?.response?.status === 501) { + setSnackbarMessage("Endpoint not yet implemented, 501"); + } else { + setSnackbarMessage("Failed to change password. Please try again."); + } + setSnackbarOpen(true); + } finally { + setIsSubmitting(false); + } } const userGroupname = user?.groupname.charAt(0).toUpperCase() + user?.groupname.slice(1) - const isPasswordFormValid = formData.currentPassword.trim() !== "" && formData.newPassword.trim() !== "" && formData.confirmPassword.trim() !== ""; + const isPasswordFormValid = formData.currentPassword.trim() !== "" && + formData.newPassword.trim() !== "" && + formData.confirmPassword.trim() !== "" && + formData.newPassword === formData.confirmPassword; return ( @@ -179,10 +235,10 @@ const AccountSettingsDialog = ({ type="submit" variant="outlined" startIcon={isPasswordFormValid ? : } - onClick={() => setShowPasswordField(true)} - disabled={!isPasswordFormValid} + onClick={handleSubmit} + disabled={!isPasswordFormValid || isSubmitting} > - Save new password + {isSubmitting ? "Saving..." : "Save new password"}