var getEndpoints = function getEndpoints(initRequest) {
  return initRequest({
    method: 'GET',
    path: 'tutorials/endpoints'
  });
};

var getCodeSnippets = function getCodeSnippets(initRequest, data) {
  return initRequest({
    method: 'POST',
    path: 'tutorials/getCodeSnippets',
    body: JSON.stringify(data)
  });
};

var getCodeString = function getCodeString(initRequest, data) {
  return initRequest({
    method: 'POST',
    path: 'tutorials/getCodeString',
    body: JSON.stringify(data)
  });
};

var createTutorial = function createTutorial(initRequest, data) {
  return initRequest({
    method: 'POST',
    path: 'tutorials',
    body: JSON.stringify(data)
  });
};

var updateTutorial = function updateTutorial(initRequest, data) {
  return initRequest({
    method: 'PUT',
    path: 'tutorials/' + data._id,
    body: JSON.stringify(data)
  });
};

var updateOnboarding = function updateOnboarding(initRequest, data) {
  return initRequest({
    method: 'POST',
    path: 'tutorials/onboarding',
    body: JSON.stringify(data)
  });
};

export { getEndpoints, getCodeSnippets, getCodeString, createTutorial, updateTutorial, updateOnboarding };