MCPcopy Create free account
hub / github.com/experdot/pointer / handleSave

Function handleSave

src/renderer/src/components/settings/LLMSettings.tsx:62–84  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

60 }, [open, config, form])
61
62 const handleSave = async () => {
63 try {
64 setLoading(true)
65 const values = await form.validateFields()
66
67 const newConfig: LLMConfig = {
68 id: config?.id || uuidv4(),
69 name: values.name,
70 apiHost: values.apiHost,
71 apiKey: values.apiKey,
72 modelName: values.modelName,
73 createdAt: config?.createdAt || Date.now(),
74 modelConfigId: values.modelConfigId
75 }
76
77 onSave(newConfig)
78 form.resetFields()
79 } catch (error) {
80 message.error('请检查输入内容')
81 } finally {
82 setLoading(false)
83 }
84 }
85
86 const fetchModels = async () => {
87 try {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected