1
0
mirror of https://github.com/oceanprotocol/docs.git synced 2024-11-26 19:49:26 +01:00

Merge pull request #754 from oceanprotocol/issue-715-fix-rest-api

Issue-715: Fix REST api issue for Provider
This commit is contained in:
Akshay 2021-09-08 13:15:29 +02:00 committed by GitHub
commit 123fe97460
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,7 +8,6 @@ import stylesSidebar from '../../components/Sidebar.module.scss'
const Toc = ({ data }) => {
const Ids = []
const itemsV1 = Object.keys(data.paths)
.filter((key) => key.startsWith('/api/v1/aquarius'))
.map((key) => {
@ -36,20 +35,30 @@ const Toc = ({ data }) => {
</li>
)
})
const getRestEndpoints = () => {
if (data.info.title === 'Aquarius') {
return (
<>
<code>/api/v1/aquarius</code>
<ul>{itemsV1}</ul>
{itemsOther.length ? (
<>
<code>Other REST endpoints</code>
<ul>{itemsOther}</ul>
</>
) : null}
</>
)
} else return <>{itemsOther}</>
}
return (
<Scrollspy
items={Ids}
currentClassName={stylesSidebar.scrollspyActive}
offset={-100}
>
<code>/api/v1/aquarius</code>
<ul>{itemsV1}</ul>
{itemsOther.length ? (
<>
<code>Other REST endpoints</code>
<ul>{itemsOther}</ul>
</>
) : null}
{getRestEndpoints()}
</Scrollspy>
)
}