import {get, post, put, del} from '../http/http'
import {uploadImage} from '../http/api/upload'

const campaign = {
  getCampaignPages(params) {
    return post("campaign/campaign-pages", params)
  },
  addCampaign(data) {
    return post("campaign/campaigns", data)
  },
  updateCampaign(data) {
    return put("campaign/campaigns", data)
  },
  viewCampaign(campaignId) {
    return get("campaign/campaigns/" + campaignId)
  },
  deleteCampaign(campaignId) {
    return del("campaign/campaigns/" + campaignId)
  },
  deleteCampaignImage(imageId) {
    return del("campaign/campaigns-images/" + imageId)
  },
  deleteCampaignLink(linkId) {
    return del("campaign/campaigns-links/" + linkId)
  },
  deleteCampaignDiscount(discountId) {
    return del("campaign/campaigns-discounts/" + discountId)
  },
  getAssignStatusOptions() {
    return get("campaign/assignment-statuses")
  },
  getCampaignAssignPages(params) {
    return post("campaign/assign-site-pages", params)
  },
  assignSites(data) {
    return post("campaign/assign-sites", data)
  },
  unassignSites(data) {
    return post("campaign/un-assign-sites", data)
  },
  uploadImages(data) {
    return uploadImage(data)
  }
}

export default campaign;