From 6f427e2faca0eef26e90941e8d5ac4f17b2d3a6a Mon Sep 17 00:00:00 2001 From: ah7255703 Date: Fri, 12 Jan 2024 01:52:39 +0200 Subject: [PATCH] Update debounce timeout in SetCopilotNameStep.tsx and add headers in createCopilot --- .../(main)/create/copilot/_parts/SetCopilotNameStep.tsx | 3 +-- dashboard/data/copilot.ts | 7 ++++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/dashboard/app/(main)/create/copilot/_parts/SetCopilotNameStep.tsx b/dashboard/app/(main)/create/copilot/_parts/SetCopilotNameStep.tsx index c3ff84deb..fd66ffa6e 100644 --- a/dashboard/app/(main)/create/copilot/_parts/SetCopilotNameStep.tsx +++ b/dashboard/app/(main)/create/copilot/_parts/SetCopilotNameStep.tsx @@ -13,7 +13,6 @@ export function SetCopilotName() { const { state: { copilot_name, createdCopilot }, dispatch } = useCreateCopilot(); const { nextStep } = useWizard(); const [value, $createCopilot] = useAsyncFn(createCopilot); - const setCopilot = (copilot: CopilotType) => { dispatch({ type: "SET_COPILOT", payload: copilot }); }; @@ -53,7 +52,7 @@ export function SetCopilotName() { ) { export async function createCopilot(copilot_name: string) { const form = new FormData() form.append('name', copilot_name) - return await instance.post('/', form) + return await instance.post('/', form, { + headers: { + 'Content-Type': 'multipart/form-data', + 'Accept': 'application/json' + } + }) } // localhost:8888/backend/copilot/5a958877-63b6-47a5-afa3-621dc57e7d1b/variables export async function getVariablesByBotId(id: string) {