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

Issue-715: Fix REST api issue for Provider

This commit is contained in:
Akshay 2021-09-08 11:41:37 +02:00
parent be253944ce
commit 86fcddefb2

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>
)
}