set username to empty string instead of undefined

This commit is contained in:
Prasang Prajapati 2025-09-04 14:36:39 -04:00
parent 3f4d5bcfc6
commit d3999923da
3 changed files with 6 additions and 3 deletions

View file

@ -26,7 +26,6 @@ export async function getWatsonxModels(
try {
let options: any = {
version: "2024-05-31",
serviceUrl: baseUrl || "https://us-south.ml.cloud.ibm.com",
}
if (platform === "ibmCloud" || !platform) {

View file

@ -1296,7 +1296,11 @@ export const CodeIndexPopover: React.FC<CodeIndexPopoverProps> = ({
<div className="space-y-2">
<label className="text-sm font-medium">Username</label>
<VSCodeTextField
value={currentSettings.watsonxUsername || ""}
value={
currentSettings.watsonxUsername
? currentSettings.watsonxUsername
: ""
}
onInput={(e: any) =>
updateSetting("watsonxUsername", e.target.value)
}

View file

@ -318,7 +318,7 @@ export const WatsonxAI = ({
</div>
<VSCodeTextField
value={apiConfiguration.watsonxUsername}
value={apiConfiguration.watsonxUsername ? apiConfiguration.watsonxUsername : ""}
onInput={handleInputChange("watsonxUsername")}
placeholder="Username"
className="w-full">