Skip to content

Commit

Permalink
chore: missing keys in APIsDisplay
Browse files Browse the repository at this point in the history
  • Loading branch information
dougfabris authored and tassoevan committed Feb 25, 2022
1 parent b441259 commit a2f0a6f
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions client/views/admin/apps/APIsDisplay.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { IApiEndpointMetadata } from '@rocket.chat/apps-engine/definition/api';
import { Box, Divider } from '@rocket.chat/fuselage';
import React, { FC } from 'react';
import React, { FC, Fragment } from 'react';

import { useAbsoluteUrl } from '../../../contexts/ServerContext';
import { useTranslation } from '../../../contexts/TranslationContext';
Expand All @@ -12,9 +12,7 @@ type APIsDisplayProps = {

const APIsDisplay: FC<APIsDisplayProps> = ({ apis }) => {
const t = useTranslation();

const absoluteUrl = useAbsoluteUrl();

const getApiCurl = apiCurlGetter(absoluteUrl);

return (
Expand All @@ -29,16 +27,16 @@ const APIsDisplay: FC<APIsDisplayProps> = ({ apis }) => {
<Box fontScale='p2m'>
{api.methods.join(' | ').toUpperCase()} {api.path}
</Box>
{api.methods.map((method) => (
<Box>
{api.methods.map((method, index) => (
<Box key={index}>
<Box withRichContent>
<pre>
<code>
{getApiCurl(method, api).map((curlAddress) => (
<>
{getApiCurl(method, api).map((curlAddress, index) => (
<Fragment key={index}>
{curlAddress}
<br />
</>
</Fragment>
))}
</code>
</pre>
Expand Down

0 comments on commit a2f0a6f

Please sign in to comment.