import instance from "@/util/request"; import apihandler from "@/util/apihandler"; import { POST_SETTING_POINT_API, GET_SETTING_TYPE_API, POST_SETTING_TYPE_API, } from "./api"; export const postProductSettingPoint = async (type, devices) => { const res = await instance.post(POST_SETTING_POINT_API, { devices: devices.map(({ device_number }) => device_number), values: [ { point: "Type", value: type.value, }, ], }); return apihandler(res.code, res.data, { msg: res.msg, code: res.code, isSuccess: false, }); }; export const getProductSettingType = async () => { const res = await instance.post(GET_SETTING_TYPE_API); return apihandler(res.code, res.data, { msg: res.msg, code: res.code, isSuccess: false, }); }; export const postProductSettingType = async (data) => { const res = await instance.post(POST_SETTING_TYPE_API, data); return apihandler(res.code, res.data, { msg: res.msg, code: res.code, isSuccess: false, }); };