| | |
| | | return null; |
| | | } |
| | | |
| | | export const updateAreaData = async (payload = {}) => { |
| | | try { |
| | | const res = await request.post('/map/area/update', payload); |
| | | const { code, msg } = res.data; |
| | | if (code === 200) { |
| | | notify.success?.(msg); |
| | | return true; |
| | | } |
| | | notify?.error?.(msg); |
| | | } catch (error) { |
| | | notify.error(error.message); |
| | | console.error(error.message); |
| | | } |
| | | return false; |
| | | }; |
| | | |
| | | export const removeArea = async (areaId) => { |
| | | try { |
| | | const res = await request.post('/map/area/remove', { areaId }); |
| | | const { code, msg } = res.data; |
| | | if (code === 200) { |
| | | notify.success(msg); |
| | | return true; |
| | | } |
| | | notify.error(msg); |
| | | } catch (error) { |
| | | notify.error(error.message); |
| | | console.error(error.message); |
| | | } |
| | | return false; |
| | | }; |
| | | |
| | | export const fetchAgvListAll = async () => { |
| | | try { |
| | | const res = await request.post('/agv/list', {}); |