{"size": 661, "ext": "js", "max_stars_repo_path": "client/src/words-service.js", "max_stars_repo_name": "jesusreal/learn-with-jesus", "max_stars_repo_stars_event_min_datetime": "2016-06-01T06:50:05.000Z", "max_stars_repo_stars_event_max_datetime": "2016-06-01T06:50:05.000Z", "max_issues_repo_path": "client/src/words-service.js", "max_issues_repo_name": "jesusreal/learn-with-jesus", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "client/src/words-service.js", "max_forks_repo_name": "jesusreal/learn-with-jesus", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 25.4230769231, "max_line_length": 77, "alphanum_fraction": 0.6248108926}
import {SERVER_URL} from './constants';
import ApiService from './api-service';

export default {
  getAll(step){
    return ApiService.get(`${SERVER_URL}/words`, {step})
  // Once words have created and last modified fields, return new words first
  //     .then((allWords) => {
  //       console.log(allWords);
  //       allWords.sort((a,b) => new Date(b.date) - new Date(a.date)))
  //       });
  },

  add(wordData){
    return ApiService.post(`${SERVER_URL}/word`, wordData)
  },

  remove(wordId){
    return ApiService.remove(`${SERVER_URL}/word`, {wordId})
  },

  update(wordData){
    return ApiService.update(`${SERVER_URL}/word`, wordData)
  }
}
