From 2052a6a00843e052a8611b834846ea8e5ec8cd50 Mon Sep 17 00:00:00 2001 From: Damian Stasik <920747+damianstasik@users.noreply.github.com> Date: Fri, 30 Aug 2024 17:51:38 +0200 Subject: [PATCH] Use updated path to the main cdktf md file Signed-off-by: Damian Stasik <920747+damianstasik@users.noreply.github.com> --- frontend/src/routes/Provider/query.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/frontend/src/routes/Provider/query.ts b/frontend/src/routes/Provider/query.ts index 68bfef12..d47093de 100644 --- a/frontend/src/routes/Provider/query.ts +++ b/frontend/src/routes/Provider/query.ts @@ -32,13 +32,14 @@ export const getProviderDocsQuery = ( return queryOptions({ queryKey: ["provider-doc", namespace, provider, type, name, lang, version], queryFn: async () => { - const urlBase = `${import.meta.env.VITE_DATA_API_URL}/providers/${namespace}/${provider}/${version}`; - const requestURL = + const urlBase = `${import.meta.env.VITE_DATA_API_URL}/providers/${namespace}/${provider}/${version}/${lang ? `cdktf/${lang}/` : ""}`; + + const path = type === undefined && name === undefined - ? `${urlBase}/${lang ? `cdktf/${lang}/s/` : ""}index.md` - : `${urlBase}/${lang ? `cdktf/${lang}/` : ""}${type}/${name}.md`; + ? `index.md` + : `${type}/${name}.md`; - const response = await fetch(requestURL); + const response = await fetch(`${urlBase}${path}`); if (!response.ok) { throw new NotFoundPageError();