Skip to content
This repository has been archived by the owner on Jan 5, 2025. It is now read-only.

Update debounce timeout in SetCopilotNameStep.tsx and add headers in createCopilot #524

Merged
merged 1 commit into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
};
Expand Down Expand Up @@ -53,7 +52,7 @@ export function SetCopilotName() {
</Label>
<DebounceInput
id="copilotName"
debounceTimeout={500}
debounceTimeout={300}
// @ts-ignore
element={Input}
disabled={!!createdCopilot}
Expand Down
7 changes: 6 additions & 1 deletion dashboard/data/copilot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,12 @@ export async function updateCopilot(id: string, copilot: Partial<CopilotType>) {
export async function createCopilot(copilot_name: string) {
const form = new FormData()
form.append('name', copilot_name)
return await instance.post<CopilotType>('/', form)
return await instance.post<CopilotType>('/', 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) {
Expand Down
Loading