-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add api to fetch admin-docs-content #347
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for leafy-mooncake-7c2e5e ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This pull request does not contain a valid label. Please add one of the following labels: ['release-no', 'release-auto', 'release-patch', 'release-minor', 'release-major']
src/pages/api/admin-docs-getfile.ts
Outdated
| } | ||
|
|
||
| try { | ||
| const fileContent = await getMarkdownFile( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aqui é melhor usar:
helpcenter/src/utils/githubCdnFallback.ts
Line 125 in e869479
| export async function fetchGitHubFileWithFallback( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Usar funções ja existentes nesse arquivo o máx possível
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tentei adaptar para usar essa função, mas o cdn fallback não funciona porque o repositório admin-docs-content é privado, dá File not found
src/pages/api/admin-docs-gettree.ts
Outdated
| res | ||
| .status(200) | ||
| .json(await getGithubTree('vtexdocs', 'admin-docs-content', 'main')) | ||
| return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Importante adicionar headers de cache que reduzem o número de requests necessárias.
Onde vai ser usada essa api?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
acho que dá para fazer sem ela e buscar direto o conteúdo. fiz um commit apagando
What is the purpose of this pull request?
What problem is this solving?
How should this be manually tested?
Screenshots or example usage
Types of changes