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:
commit
123fe97460
@ -8,7 +8,6 @@ import stylesSidebar from '../../components/Sidebar.module.scss'
|
|||||||
|
|
||||||
const Toc = ({ data }) => {
|
const Toc = ({ data }) => {
|
||||||
const Ids = []
|
const Ids = []
|
||||||
|
|
||||||
const itemsV1 = Object.keys(data.paths)
|
const itemsV1 = Object.keys(data.paths)
|
||||||
.filter((key) => key.startsWith('/api/v1/aquarius'))
|
.filter((key) => key.startsWith('/api/v1/aquarius'))
|
||||||
.map((key) => {
|
.map((key) => {
|
||||||
@ -36,20 +35,30 @@ const Toc = ({ data }) => {
|
|||||||
</li>
|
</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 (
|
return (
|
||||||
<Scrollspy
|
<Scrollspy
|
||||||
items={Ids}
|
items={Ids}
|
||||||
currentClassName={stylesSidebar.scrollspyActive}
|
currentClassName={stylesSidebar.scrollspyActive}
|
||||||
offset={-100}
|
offset={-100}
|
||||||
>
|
>
|
||||||
<code>/api/v1/aquarius</code>
|
{getRestEndpoints()}
|
||||||
<ul>{itemsV1}</ul>
|
|
||||||
{itemsOther.length ? (
|
|
||||||
<>
|
|
||||||
<code>Other REST endpoints</code>
|
|
||||||
<ul>{itemsOther}</ul>
|
|
||||||
</>
|
|
||||||
) : null}
|
|
||||||
</Scrollspy>
|
</Scrollspy>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user