chore: competion webapp

This commit is contained in:
Joel
2025-07-09 14:56:11 +08:00
parent 8c8c250570
commit 912d68a148
3 changed files with 20 additions and 6 deletions

View File

@ -132,7 +132,7 @@ export const promptVariablesToUserInputsForm = (promptVariables: PromptVariable[
}
if (item.type === 'number' || item.type === 'boolean') {
userInputs.push({
number: {
[item.type]: {
label: item.name,
variable: item.key,
required: item.required !== false, // default true
@ -173,7 +173,7 @@ export const promptVariablesToUserInputsForm = (promptVariables: PromptVariable[
return userInputs
}
export const formatBooleanInputs = (useInputs: PromptVariable[] | null, inputs: Record<string, string | number | object | boolean>) => {
export const formatBooleanInputs = (useInputs?: PromptVariable[] | null, inputs?: Record<string, string | number | object | boolean>) => {
if(!useInputs)
return inputs
const res = { ...(inputs || {}) }