/*
 *
 * WebPush actions
 *
 */

import * as types from './constants';

export function createTemplate(template, callback, meta) {
  return {
    type: types.CREATE_TEMPLATE_REQUEST,
    template,
    callback,
    meta,
  };
}

export function clearCreateResponse() {
  return {
    type: types.CLEAR_CREATE_RESPONSE_REQUEST,
  };
}

export function editTemplate(template, callback) {
  return {
    type: types.EDIT_TEMPLATE_REQUEST,
    template,
    callback,
  };
}

export function clearEditResponse() {
  return {
    type: types.CLEAR_EDIT_RESPONSE_REQUEST,
  };
}

export function defaultAction() {
  return {
    type: types.DEFAULT_ACTION,
  };
}

export function uploadWebPushAsset(file, type, fileParams, templateType) {
  return {
    type: types.UPLOAD_WEBPUSH_ASSET_REQUEST,
    file,
    assetType: type,
    fileParams,
    templateType,
  };
}

export function clearWebPushAsset(templateType) {
  return {
    type: types.CLEAR_WEBPUSH_ASSET,
    templateType,
  };
}

