[App Search] Fix bash API code example (#106015)

* Fix bash/curl API code example not correctly having `\`s at the end of non-body lines

- Doing this requires removing the `dedent()` fn which is messing up backslashes

- Removing dedent requires setting the template literal indentation to 0 and changing the indent level on DOCUMENTS_API_JSON_EXAMPLE

* I unindented DOCUMENTS_API_JSON_EXAMPLE too hard
- the { is no longer lined up with the [ I think??? what am I even doing with my life
This commit is contained in:
Constance 2021-07-16 16:25:55 -07:00 committed by GitHub
parent 5b68c54568
commit da7c43c1db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 47 additions and 50 deletions

View file

@ -7,8 +7,6 @@
import React from 'react';
import dedent from 'dedent';
import { useValues, useActions } from 'kea';
import {
@ -107,10 +105,10 @@ export const FlyoutBody: React.FC = () => {
</EuiFlexGroup>
</EuiPanel>
<EuiCodeBlock language="bash" fontSize="m" isCopyable>
{dedent(`
curl -X POST '${documentsApiUrl}'
-H 'Content-Type: application/json'
-H 'Authorization: Bearer ${apiKey}'
{`\
curl -X POST '${documentsApiUrl}' \\
-H 'Content-Type: application/json' \\
-H 'Authorization: Bearer ${apiKey}' \\
-d '${DOCUMENTS_API_JSON_EXAMPLE}'
# Returns
# [
@ -122,8 +120,7 @@ export const FlyoutBody: React.FC = () => {
# "id": "park_saguaro",
# "errors": []
# }
# ]
`)}
# ]`}
</EuiCodeBlock>
</EuiFlyoutBody>
);