docs: Update api reference (#1410)

This commit is contained in:
Shahed Nasser
2022-05-24 14:22:42 +03:00
committed by GitHub
parent 5e0e5b90fc
commit 08c63097f9
7 changed files with 6338 additions and 3001 deletions
+3819 -585
View File
File diff suppressed because it is too large Load Diff
+1126 -1047
View File
File diff suppressed because it is too large Load Diff
+677 -667
View File
File diff suppressed because it is too large Load Diff
+707 -699
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -7,7 +7,7 @@ routes:
path: /products/:id
route: /products
description: >
A product represents the object, that is to be sold on the website. A product can have variants, that differ by e.g. size and color.
A product represents the object, that are to be sold on the website. A product can have variants, that differ by e.g. size and color.
endpoints:
- path: /:id
method: GET
+3 -2
View File
@@ -20,8 +20,9 @@ const createCustomNode = ({ name, node, createNode }) => {
let requestBodyValues = undefined
if (values.requestBody && values.requestBody.content) {
requestBodyValues =
values.requestBody.content["application/json"].schema
requestBodyValues = values.requestBody.content.hasOwnProperty("application/json") ?
values.requestBody.content["application/json"].schema :
values.requestBody.content["multipart/form-data"].schema
}
return {
@@ -6,11 +6,16 @@ import React from 'react'
import { ThemeToggler } from 'gatsby-plugin-dark-mode'
import { useColorMode } from 'theme-ui'
const isBrowser = typeof window !== "undefined"
export default function ColorModeToggler () {
const [, setColorMode] = useColorMode()
function checkLocalStorage (currentTheme, toggleTheme) {
//check that theme local storage values are set correctly
if (!isBrowser) {
return currentTheme;
}
let themeUiColorMode = window.localStorage.getItem('theme-ui-color-mode');
let theme = window.localStorage.getItem('theme')
if (!themeUiColorMode) {