From e9c2deee5ff935ee941925aafcf3e70bce850ce6 Mon Sep 17 00:00:00 2001 From: Baptiste Arnaud Date: Thu, 8 Jun 2023 15:56:52 +0200 Subject: [PATCH] :bug: (openai) Fix default response mapping item --- apps/builder/src/components/TableList.tsx | 4 +++- .../createChatCompletion/OpenAIChatCompletionSettings.tsx | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/builder/src/components/TableList.tsx b/apps/builder/src/components/TableList.tsx index 41d3944571f..a35abc7c0a9 100644 --- a/apps/builder/src/components/TableList.tsx +++ b/apps/builder/src/components/TableList.tsx @@ -22,6 +22,7 @@ type Props = { initialItems: ItemWithId[] isOrdered?: boolean addLabel?: string + newItemDefaultProps?: Partial Item: (props: TableListItemProps) => JSX.Element ComponentBetweenItems?: (props: unknown) => JSX.Element onItemsChange: (items: ItemWithId[]) => void @@ -31,6 +32,7 @@ export const TableList = ({ initialItems, isOrdered, addLabel = 'Add', + newItemDefaultProps, Item, ComponentBetweenItems, onItemsChange, @@ -40,7 +42,7 @@ export const TableList = ({ const createItem = () => { const id = createId() - const newItem = { id } as ItemWithId + const newItem = { id, ...newItemDefaultProps } as ItemWithId setItems([...items, newItem]) onItemsChange([...items, newItem]) } diff --git a/apps/builder/src/features/blocks/integrations/openai/components/createChatCompletion/OpenAIChatCompletionSettings.tsx b/apps/builder/src/features/blocks/integrations/openai/components/createChatCompletion/OpenAIChatCompletionSettings.tsx index ccb5ed063e7..da0db122cec 100644 --- a/apps/builder/src/features/blocks/integrations/openai/components/createChatCompletion/OpenAIChatCompletionSettings.tsx +++ b/apps/builder/src/features/blocks/integrations/openai/components/createChatCompletion/OpenAIChatCompletionSettings.tsx @@ -124,12 +124,12 @@ export const OpenAIChatCompletionSettings = ({ -