js/controllers/SchedulesController.js
// i receive the values from the form
i receive the values from the form
i receive the values from the form
createSchedules(){
      if ( ! this.validate(this.formCreate) ) return false;
      let time = this.formCreate.time.element.value;
      let day = this.formCreate.day.element.value;
      let course = this.formCreate.course.element.value;
      let subject = this.formCreate.subject.element.value;
      let teacher = this.formCreate.teacher.element.value;
      let schedule = new Schedule(null, time, day, course, subject, teacher);
      schedulesService.create(schedule)
      .then(response => {
        console.log(JSON.stringify(response))
        $('#modal-create-schedules').modal('hide');
        this.showMessage(response.message);
        this.listSchedules();
        this.resetForm('create');
      })
    }
createSchedules ( ) { if ( ! this . validate ( this . formCreate ) ) return false ; let time = this . formCreate . time . element . value ; let day = this . formCreate . day . element . value ; let course = this . formCreate . course . element . value ; let subject = this . formCreate . subject . element . value ; let teacher = this . formCreate . teacher . element . value ; let schedule = new Schedule ( null , time , day , course , subject , teacher ) ; schedulesService . create ( schedule ) . then ( response => { console . log ( JSON . stringify ( response ) ) $ ( '#modal-create-schedules' ) . modal ( 'hide' ) ; this . showMessage ( response . message ) ; this . listSchedules ( ) ; this . resetForm ( 'create' ) ; } ) }
i receive the values from the form
i receive the values from the form