You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
491 B
23 lines
491 B
11 months ago
|
import api from './api';
|
||
|
import handleAPIError from './handleAPIError';
|
||
|
|
||
|
const setMapNetwork = (
|
||
|
value: 0 | 1,
|
||
|
handleError?: (msg: Message) => void,
|
||
|
): void => {
|
||
|
api.put('/init/set-map-network', { value }).catch((error) => {
|
||
|
const emsg = handleAPIError(error);
|
||
|
|
||
|
emsg.children = (
|
||
|
<>
|
||
|
Failed to {value ? 'enable' : 'disable'} network mapping.{' '}
|
||
|
{emsg.children}
|
||
|
</>
|
||
|
);
|
||
|
|
||
|
handleError?.call(null, emsg);
|
||
|
});
|
||
|
};
|
||
|
|
||
|
export default setMapNetwork;
|