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

Function getOptions

web/src/components/settings/ChatsSetting.js:14–34  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers 1

onRefreshFunction · 0.70

Calls 2

toBooleanFunction · 0.90
showErrorFunction · 0.90

Tested by

no test coverage detected