var env = require('./environment');
var server = env.server + ':' + env.port;

module.exports = {
  login: (username, password) => {
    return fetch(server + '/login', {
        method: 'POST',
        headers: {
          'Accept': 'application/json',
          'Content-Type': 'application/json',
        },
        body: JSON.stringify({
          username: username,
          password: password
        })
      });
  },

  signup: (username, password, teacherOrStudent) => {
    return fetch(server + '/signup', {
        method: 'POST',
        headers: {
          'Accept': 'application/json',
          'Content-Type': 'application/json',
        },
        // add firstName and lastName
        body: JSON.stringify({
          username: username,
          password: password,
          accountType: teacherOrStudent
        })
      });
  },

  getLessons: (classId) => {
    return fetch(server + '/teachers/lessons/' + classId);
  },

  getLessonData: (lessonId) => {
    return fetch(server + '/teachers/polls/' + lessonId);
  },
  
  startPoll: (pollObject, lessonId) => {    
      return fetch(server + '/teachers/polls', {
        method: 'POST',
        headers: {
          'Accept': 'application/json',
          'Content-Type': 'application/json',
        },
        body: JSON.stringify({
          pollObject: pollObject,
          lessonId: lessonId
        })
      });
  }
}


@@ -451,16 +451,37 @@
 assword,
+ firstName, lastName,
  teacher
@@ -736,32 +736,94 @@
 SON.stringify(%7B%0A
+          firstName: firstName,%0A          lastName: lastName,%0A
           userna

Add first name and last name to signup api function