{"size": 1203, "ext": "js", "max_stars_repo_path": "src/actions/remoteactions.js", "max_stars_repo_name": "SOUTOVACWAY/vw-lockers-frontend", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/actions/remoteactions.js", "max_issues_repo_name": "SOUTOVACWAY/vw-lockers-frontend", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/actions/remoteactions.js", "max_forks_repo_name": "SOUTOVACWAY/vw-lockers-frontend", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 28.6428571429, "max_line_length": 68, "alphanum_fraction": 0.744804655}
import { CALL_API } from '../middleware/api'

export const REMOTE_ACTIONS_REQUEST = 'REMOTE_ACTIONS_REQUEST'
export const REMOTE_ACTIONS_SUCCESS = 'REMOTE_ACTIONS_SUCCESS'
export const REMOTE_ACTIONS_FAILURE = 'REMOTE_ACTIONS_FAILURE'

export function fetchRemoteActions(machine_serial) {
  return {
    [CALL_API]: {
      method: 'GET',
      endpoint: `remoteactions/${machine_serial}`,
      authenticated: true,
      types: [REMOTE_ACTIONS_REQUEST, REMOTE_ACTIONS_SUCCESS,
              REMOTE_ACTIONS_FAILURE]
    }
  }
}

export const REMOTE_ACTION_ADD_REQUEST = 'REMOTE_ACTION_ADD_REQUEST'
export const REMOTE_ACTION_ADD_SUCCESS = 'REMOTE_ACTION_ADD_SUCCESS'
export const REMOTE_ACTION_ADD_FAILURE = 'REMOTE_ACTION_ADD_FAILURE'

export function addRemoteAction(remoteAction) {
  return {
    [CALL_API]: {
      method: 'POST',
      endpoint: 'remoteactions',
      authenticated: true,
      body: JSON.stringify(remoteAction),
      types: [REMOTE_ACTION_ADD_REQUEST, REMOTE_ACTION_ADD_SUCCESS,
              REMOTE_ACTION_ADD_FAILURE]
    }
  }
}

export const REMOTE_ACTIONS_RESET = 'REMOTE_ACTIONS_RESET'

export function resetremoteActions() {
  return { type: REMOTE_ACTIONS_RESET }
}

