MCPcopy Create free account
hub / github.com/aiprodcoder/MIXAPI / getOptions

Function getOptions

web/src/components/settings/DashboardSetting.js:37–55  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

35 const [showMigrateModal, setShowMigrateModal] = useState(false); // 下个版本会删除
36
37 const getOptions = async () => {
38 const res = await API.get('/api/option/');
39 const { success, message, data } = res.data;
40 if (success) {
41 let newInputs = {};
42 data.forEach((item) => {
43 if (item.key in inputs) {
44 newInputs[item.key] = item.value;
45 }
46 if (item.key.endsWith('Enabled') &&
47 (item.key === 'DataExportEnabled')) {
48 newInputs[item.key] = toBoolean(item.value);
49 }
50 });
51 setInputs(newInputs);
52 } else {
53 showError(message);
54 }
55 };
56
57 async function onRefresh() {
58 try {

Callers 1

onRefreshFunction · 0.70

Calls 2

toBooleanFunction · 0.90
showErrorFunction · 0.90

Tested by

no test coverage detected