docs: Update api reference (#1410)
This commit is contained in:
+3819
-585
File diff suppressed because it is too large
Load Diff
+1126
-1047
File diff suppressed because it is too large
Load Diff
+677
-667
File diff suppressed because it is too large
Load Diff
+707
-699
File diff suppressed because it is too large
Load Diff
@@ -7,7 +7,7 @@ routes:
|
|||||||
path: /products/:id
|
path: /products/:id
|
||||||
route: /products
|
route: /products
|
||||||
description: >
|
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:
|
endpoints:
|
||||||
- path: /:id
|
- path: /:id
|
||||||
method: GET
|
method: GET
|
||||||
|
|||||||
@@ -20,8 +20,9 @@ const createCustomNode = ({ name, node, createNode }) => {
|
|||||||
let requestBodyValues = undefined
|
let requestBodyValues = undefined
|
||||||
|
|
||||||
if (values.requestBody && values.requestBody.content) {
|
if (values.requestBody && values.requestBody.content) {
|
||||||
requestBodyValues =
|
requestBodyValues = values.requestBody.content.hasOwnProperty("application/json") ?
|
||||||
values.requestBody.content["application/json"].schema
|
values.requestBody.content["application/json"].schema :
|
||||||
|
values.requestBody.content["multipart/form-data"].schema
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -6,11 +6,16 @@ import React from 'react'
|
|||||||
import { ThemeToggler } from 'gatsby-plugin-dark-mode'
|
import { ThemeToggler } from 'gatsby-plugin-dark-mode'
|
||||||
import { useColorMode } from 'theme-ui'
|
import { useColorMode } from 'theme-ui'
|
||||||
|
|
||||||
|
const isBrowser = typeof window !== "undefined"
|
||||||
|
|
||||||
export default function ColorModeToggler () {
|
export default function ColorModeToggler () {
|
||||||
const [, setColorMode] = useColorMode()
|
const [, setColorMode] = useColorMode()
|
||||||
|
|
||||||
function checkLocalStorage (currentTheme, toggleTheme) {
|
function checkLocalStorage (currentTheme, toggleTheme) {
|
||||||
//check that theme local storage values are set correctly
|
//check that theme local storage values are set correctly
|
||||||
|
if (!isBrowser) {
|
||||||
|
return currentTheme;
|
||||||
|
}
|
||||||
let themeUiColorMode = window.localStorage.getItem('theme-ui-color-mode');
|
let themeUiColorMode = window.localStorage.getItem('theme-ui-color-mode');
|
||||||
let theme = window.localStorage.getItem('theme')
|
let theme = window.localStorage.getItem('theme')
|
||||||
if (!themeUiColorMode) {
|
if (!themeUiColorMode) {
|
||||||
|
|||||||
Reference in New Issue
Block a user