From 34153729f017b67fb5f1bf465c89dfa6cb92d709 Mon Sep 17 00:00:00 2001 From: Daniel Date: Wed, 2 Aug 2023 11:07:57 -0400 Subject: [PATCH] Add qs.stringfy to clean up api doc url --- src/templates/APIPage/APIPage.jsx | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/templates/APIPage/APIPage.jsx b/src/templates/APIPage/APIPage.jsx index 5489d288..e3c54c9b 100644 --- a/src/templates/APIPage/APIPage.jsx +++ b/src/templates/APIPage/APIPage.jsx @@ -1,20 +1,25 @@ import React from 'react'; +import qs from 'qs'; import SwaggerUI from 'swagger-ui-react'; import 'swagger-ui-react/swagger-ui.css'; -const APIPage = ({ hideAuth, additionalParams, rootUrl }) => ( -
+const APIPage = ({ hideAuth, additionalParams, rootUrl }) => { + const hasACA = additionalParams && additionalParams.ACA ? true : false; + let params = { + authentication: hideAuth ? false : undefined, + ACA: hasACA ? additionalParams.ACA : undefined, + redirect: hasACA ? false : undefined, + }; + return ( +
-); + ) +}; APIPage.defaultProps = { hideAuth: true,