Skip to content

Commit 26e648c

Browse files
authored
🐛 Fix the issue where the frontend still throws an exception after successfully batch modifying the model configuration #1439
2 parents 7a36ccf + 03c7e57 commit 26e648c

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

frontend/app/[locale]/setup/models/components/model/ModelDeleteDialog.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -453,15 +453,12 @@ export const ModelDeleteDialog = ({
453453
maxTokens: maxTokens || m.maxTokens,
454454
}));
455455

456-
const result = await modelService.updateBatchModel(
456+
await modelService.updateBatchModel(
457457
currentModelPayloads
458458
);
459459

460-
if (result.code !== 200) {
461-
message.error(t("model.dialog.error.noModelsFetched"));
462-
} else {
463-
message.success(t("model.dialog.success.updateSuccess"));
464-
}
460+
// Show success message since no exception was thrown
461+
message.success(t("model.dialog.success.updateSuccess"));
465462

466463
// Optionally use currentModelPayloads for subsequent API calls if needed
467464
} catch (e) {

frontend/public/locales/en/common.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@
564564
"model.dialog.error.connectivityRequired": "Please verify model connectivity and ensure connection is successful before adding the model",
565565
"model.dialog.error.addFailed": "Failed to add model",
566566
"model.dialog.error.addFailedLog": "Failed to add model",
567-
"model.dialog.error.noModelsFetched": "Please check your API key and network connectivity",
567+
"model.dialog.error.noModelsFetched": "Operation failed! Please check your API key and network connectivity",
568568
"model.dialog.message.noModels": "Please fetch models first",
569569
"model.dialog.success.updateSuccess": "Updated successfully",
570570
"model.dialog.editTitle": "Edit Model",

frontend/public/locales/zh/common.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@
564564
"model.dialog.error.connectivityRequired": "请先验证模型连通性且确保连接成功后再添加模型",
565565
"model.dialog.error.addFailed": "添加模型失败",
566566
"model.dialog.error.addFailedLog": "添加模型失败",
567-
"model.dialog.error.noModelsFetched": "请检查相关API Key以及网络连通性",
567+
"model.dialog.error.noModelsFetched": "操作失败!请检查相关API Key以及网络连通性",
568568
"model.dialog.message.noModels": "请先获取模型",
569569
"model.dialog.editTitle": "编辑模型",
570570
"model.dialog.editSuccess": "模型更新成功",

0 commit comments

Comments
 (0)