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

Function getOptions

web/src/components/settings/DrawingSetting.js:19–36  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

17 let [loading, setLoading] = useState(false);
18
19 const getOptions = async () => {
20 const res = await API.get('/api/option/');
21 const { success, message, data } = res.data;
22 if (success) {
23 let newInputs = {};
24 data.forEach((item) => {
25 if (item.key.endsWith('Enabled')) {
26 newInputs[item.key] = toBoolean(item.value);
27 } else {
28 newInputs[item.key] = item.value;
29 }
30 });
31
32 setInputs(newInputs);
33 } else {
34 showError(message);
35 }
36 };
37
38 async function onRefresh() {
39 try {

Callers 1

onRefreshFunction · 0.70

Calls 2

toBooleanFunction · 0.90
showErrorFunction · 0.90

Tested by

no test coverage detected