diff --git a/src/templates/Swagger/Toc.jsx b/src/templates/Swagger/Toc.jsx index 31d62322..165ef488 100644 --- a/src/templates/Swagger/Toc.jsx +++ b/src/templates/Swagger/Toc.jsx @@ -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 }) => { ) }) + + const getRestEndpoints = () => { + if (data.info.title === 'Aquarius') { + return ( + <> + /api/v1/aquarius + + {itemsOther.length ? ( + <> + Other REST endpoints + + + ) : null} + + ) + } else return <>{itemsOther} + } return ( - /api/v1/aquarius - - {itemsOther.length ? ( - <> - Other REST endpoints - - - ) : null} + {getRestEndpoints()} ) }