import http from '@/utils/http'
import { AppDispatch } from '..'
/**
 * 回收站 - 获取分页列表
 */
export const C8_APIgetList = (data: any): any => {
  return async (dispatch: AppDispatch) => {
    const res = await http.post('cms/goodsBin/page', data)
    if (res.code === 0) {
      const obj = {
        list: res.data.records,
        total: res.data.total
      }

      dispatch({ type: 'C8/getList', payload: obj })
    }
  }
}

/**
 * 回收站-恢复
 */
export const C8_APIrecover = (id: number) => {
  return http.get(`cms/goodsBin/recover/${id}`)
}
