From 93f40a02d0b486c4fc1fa8ae1cf8675bd5088da8 Mon Sep 17 00:00:00 2001 From: utkarsha-deriv Date: Wed, 10 Jan 2024 18:50:51 +0400 Subject: [PATCH 1/2] fix: production fix for examples key inside crypto_estimations --- .../SchemaBodyHeader/index.tsx | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/features/Apiexplorer/Schema/RecursiveContent/SchemaBodyHeader/index.tsx b/src/features/Apiexplorer/Schema/RecursiveContent/SchemaBodyHeader/index.tsx index e7dc00c1..2bfdc6d4 100644 --- a/src/features/Apiexplorer/Schema/RecursiveContent/SchemaBodyHeader/index.tsx +++ b/src/features/Apiexplorer/Schema/RecursiveContent/SchemaBodyHeader/index.tsx @@ -10,7 +10,7 @@ type TSchemaBodyHeader = { title: string; is_open_object: boolean; setIsOpenObject: (boolean) => void; - examples: string[]; + examples: string[] | number; enum; is_stream_types: boolean; items_type?: string; @@ -144,13 +144,17 @@ const SchemaBodyHeader = ({ {examples && (
example: - {examples.map((el: string, i: number) => { - return ( -
- {el} -
- ); - })} + {Array.isArray(examples) ? ( + examples.map((el: string, i: number) => { + return ( +
+ {el} +
+ ); + }) + ) : ( + {examples} + )}
)} From bb4789aad3b3c9d9919055d9e53ae65bc608df30 Mon Sep 17 00:00:00 2001 From: utkarsha-deriv Date: Wed, 10 Jan 2024 19:03:03 +0400 Subject: [PATCH 2/2] fix: resolve comments remove return --- .../RecursiveContent/SchemaBodyHeader/index.tsx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/features/Apiexplorer/Schema/RecursiveContent/SchemaBodyHeader/index.tsx b/src/features/Apiexplorer/Schema/RecursiveContent/SchemaBodyHeader/index.tsx index 2bfdc6d4..43adb987 100644 --- a/src/features/Apiexplorer/Schema/RecursiveContent/SchemaBodyHeader/index.tsx +++ b/src/features/Apiexplorer/Schema/RecursiveContent/SchemaBodyHeader/index.tsx @@ -145,13 +145,11 @@ const SchemaBodyHeader = ({
example: {Array.isArray(examples) ? ( - examples.map((el: string, i: number) => { - return ( -
- {el} -
- ); - }) + examples.map((el: string, i: number) => ( +
+ {el} +
+ )) ) : ( {examples} )}