Skip to content

Commit

Permalink
Use updated path to the main cdktf md file
Browse files Browse the repository at this point in the history
Signed-off-by: Damian Stasik <[email protected]>
  • Loading branch information
damianstasik committed Aug 30, 2024
1 parent f1621d9 commit 2052a6a
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions frontend/src/routes/Provider/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 2052a6a

Please sign in to comment.