import { config, networkUtils } from '../../utils';

const { api } = config;
const { sys } = api;
const { reminders } = sys;

export async function query(params) {
  return networkUtils.request({
    url: reminders,
    method: 'get',
    data: params,
  });
}

export async function getSingle(id) {
  return networkUtils.request({
    url: `${reminders}/${id}`,
    method: 'get',
  });
}

export async function create(params) {
  return networkUtils.request({
    url: reminders,
    method: 'post',
    data: params,
  });
}

export async function update(params) {
  return networkUtils.request({
    url: reminders,
    method: 'post',
    data: params,
  });
}

export async function disable(id) {
  return networkUtils.request({
    url: `${reminders}/${id}/x`,
    method: 'post',
  });
}

export async function enable(id) {
  return networkUtils.request({
    url: `${reminders}/${id}/o`,
    method: 'post',
  });
}

