{"size": 559, "ext": "js", "max_stars_repo_path": "src/services/userService.js", "max_stars_repo_name": "rootstrap/open-form-admin-webapp", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/services/userService.js", "max_issues_repo_name": "rootstrap/open-form-admin-webapp", "max_issues_repo_issues_event_min_datetime": "2019-10-23T21:51:27.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-10T19:48:11.000Z", "max_forks_repo_path": "src/services/userService.js", "max_forks_repo_name": "rootstrap/open-form-admin-webapp", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 7, "max_forks_count": null, "avg_line_length": 20.7037037037, "max_line_length": 81, "alphanum_fraction": 0.5813953488}
import api from 'api';

class UserService {
  static login() {
    /**
     * TODO
     * I mocked the login res because auth is not implemented yet on openform api
     * It should be replaced later with the proper endpoint
     */
    return new Promise(resolve => {
      setTimeout(() => {
        resolve({ data: { user: { name: 'john', email: 'john@doe' } } });
      }, 300);
    });
  }

  static logout() {
    return api.delete('/users/sign_out');
  }

  static signUp(user) {
    return api.post('/users', user);
  }
}

export default UserService;
