Skip to content

Commit 989f3fa

Browse files
author
Keivan Vosoughi
committed
Test
1 parent afd5776 commit 989f3fa

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

app/client/src/pages/Settings/EditModelProvider.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ const GEMINI_MODELS_OPTIONS = GEMINI_MODELS.map((model: string) => ({
6060

6161
interface Props {
6262
refetch: () => void;
63+
onClose: () => void;
6364
model: CustomModel;
6465
}
6566

@@ -92,14 +93,13 @@ const EditModelProvider: React.FC<Props> = ({ model, refetch }) => {
9293
message: 'Success',
9394
description: `THe model provider has been edited successfully!.`
9495
});
95-
setShowModal(false);
9696
refetch();
9797
}
9898
}, [mutation.error, mutation.isSuccess]);
9999

100100
const onCancel = () => {
101101
form.resetFields();
102-
setShowModal(false);
102+
onClose()
103103
}
104104

105105
const onSubmit = async () => {
@@ -140,7 +140,7 @@ const EditModelProvider: React.FC<Props> = ({ model, refetch }) => {
140140

141141
return (
142142
<>
143-
{showModal && <Modal
143+
<Modal
144144
visible
145145
okText={`Edit`}
146146
title={`Edit Model Provider`}
@@ -228,7 +228,7 @@ const EditModelProvider: React.FC<Props> = ({ model, refetch }) => {
228228
<Input.Password />
229229
</Form.Item>
230230
</Form>
231-
</Modal>}
231+
</Modal>
232232
</>
233233
);
234234
}

app/client/src/pages/Settings/SettingsPage.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,12 @@ const SettingsPage: React.FC = () => {
9090
const onDelete = (model: CustomModel) => {
9191
Modal.confirm({
9292
content: (
93-
<span>{`Are you sure you want to delete the model ${model}`}</span>
93+
<span>{`Are you sure you want to delete the model ${model.display_name}`}</span>
9494
),
9595
onOk: async () => {
9696
try {
9797
mutation.mutate({
98-
model_id: model.model_id,
99-
provider_type: model.provider_type
98+
endpoint_id: model.endpoint_id
10099
})
101100
} catch (error) {
102101
notification.error({
@@ -224,7 +223,8 @@ const SettingsPage: React.FC = () => {
224223
</Col>
225224
</Row>
226225
</Container>
227-
{showModal && <EditModelProvider model={model as CustomModel} refetch={filteredModelsReq.refetch} />}
226+
{showModal &&
227+
<EditModelProvider model={model as CustomModel} refetch={filteredModelsReq.refetch} onClose={() => setShowModal(false)} />}
228228
</StyledContent>
229229
</Layout>
230230
);

0 commit comments

Comments
 (0)