Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const fetchWithAuth = (url, options = {}) => {
if (!options.headers) options.headers = new Headers({ Accept: 'application/ld+json' });
fetchHeaders(options)
// fix https://github.com/api-platform/api-platform/issues/584
if (apiPlatformPrefix) {
url = url.replace(`${apiPlatformPrefix}${apiPlatformPrefix}/`, `${apiPlatformPrefix}/`)
}
return fetchHydra(url, options);
};
const fetchHydra = (url, options = {}) => baseFetchHydra(url, {
...options,
headers: new Headers(fetchHeaders),
});
const apiDocumentationParser = (entrypoint) => parseHydraDocumentation(entrypoint, { headers: new Headers(fetchHeaders) })
api: result.api,
customRoutes: [{
props: {
path: '/',
render: () => ,
},
}],
});
default:
return Promise.reject(result);
}
},
);
const dataProvider = baseDataProvider(entrypoint, fetchHydra, apiDocumentationParser);
export default props => (
);
const restClient = (api) => (hydraClient(api, fetchWithAuth));