(key, value)
| 34 | }); |
| 35 | |
| 36 | const updateOption = async (key, value) => { |
| 37 | setLoading(true); |
| 38 | const res = await API.put('/api/option/', { |
| 39 | key, |
| 40 | value, |
| 41 | }); |
| 42 | const { success, message } = res.data; |
| 43 | if (success) { |
| 44 | setInputs((inputs) => ({ ...inputs, [key]: value })); |
| 45 | } else { |
| 46 | showError(message); |
| 47 | } |
| 48 | setLoading(false); |
| 49 | }; |
| 50 | |
| 51 | const [loadingInput, setLoadingInput] = useState({ |
| 52 | Notice: false, |
no test coverage detected