1
0
mirror of synced 2025-12-23 11:54:18 -05:00

refactor rest context provider to be generic (#29021)

This commit is contained in:
Rachael Sewell
2022-07-14 07:09:38 -07:00
committed by GitHub
parent d738183157
commit 26e4dbc4bf
5 changed files with 32 additions and 30 deletions

View File

@@ -8,7 +8,7 @@ import { MarkdownContent } from 'components/ui/MarkdownContent'
import { Lead } from 'components/ui/Lead'
import { RestOperation } from './RestOperation'
import styles from './RestOperation.module.scss'
import { useRestContext } from 'components/context/RestContext'
import { useAutomatedPageContext } from 'components/context/AutomatedPageContext'
import { Operation } from './types'
const ClientSideHighlightJS = dynamic(() => import('components/article/ClientSideHighlightJS'), {
@@ -28,7 +28,7 @@ export type StructuredContentT = {
export const RestReferencePage = ({ restOperations }: StructuredContentT) => {
const { asPath } = useRouter()
const { title, intro, renderedPage } = useRestContext()
const { title, intro, renderedPage } = useAutomatedPageContext()
// We have some one-off redirects for rest api docs
// currently those are limited to the repos page, but
// that will grow soon as we restructure the rest api docs.