Skip to content

Commit

Permalink
fix(client): leftout api import
Browse files Browse the repository at this point in the history
  • Loading branch information
JPBM135 committed Apr 25, 2023
1 parent f3e7d85 commit d47088b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
12 changes: 8 additions & 4 deletions packages/client/src/components/UrlAnalyzerTabs/Request.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@ import { makeApiRequest } from '@app/utils/makeApiReq';
// @ts-expect-error: No types for highlight.js styles
import style from 'highlight.js/styles/atom-one-dark.css';
import { useState } from 'react';
import type { FormatBodyReturn } from '../../../../api/src/utils/formatBody';
import { CodeRenderer } from '../CodeRenderer';
import { FormatHeaders } from './RequestHeaders';

interface RawFormattedData {
data: string;
ok: boolean;
}

interface FormattedBodies {
[key: string]: FormatBodyReturn | boolean;
[key: string]: RawFormattedData | boolean;
}

const formatBody = async ({
Expand Down Expand Up @@ -158,8 +162,8 @@ export function Requests({ result }: { result: UrlAnalysisResult }) {
<div className="bg-gray-600 break-all p-3 rounded word-wrap">Loading...</div>
) : (
<CodeRenderer
data={(formattedBodies[request.id]! as FormatBodyReturn).data}
ok={(formattedBodies[request.id]! as FormatBodyReturn).ok}
data={(formattedBodies[request.id]! as RawFormattedData).data}
ok={(formattedBodies[request.id]! as RawFormattedData).ok}
/>
)
) : (
Expand Down
1 change: 0 additions & 1 deletion packages/client/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts",
"../api/src/utils/formatBody.ts"
],
"exclude": [
"node_modules"
Expand Down

0 comments on commit d47088b

Please sign in to comment.