main-project/app/client/src/Components/Admin/NewHoursEntry.js
/* Function for adding a completed new entry */
Function for adding a completed new entry
Function for adding a completed new entry
newEntry() {
    const compDT = new Date(
      this.state.date + " " + this.state.time
    ).toISOString();
    this.modal(<LoadingModal text="Creating New Entry ..." />);
    genHours(
      this.email,
      this.state.purpose,
      this.state.numHours,
      this.state.paid,
      compDT
    )
      .then(success => {
        this.modal("");
        this.reload();
      })
      .catch(err => {
        console.log(err);
        if (err.stat === 403) {
          this.modal(
            <LoadingModal
              text={
                <span>
                  Your login has expired
                  <br />
                  Please reauthenticate
                  <br />
                  Singing you out ...
                </span>
              }
            />
          );
          setTimeout(() => window.location.reload(0), 1000);
        } else {
          this.modal(
            <StatusModal
              title="Could Not Create New Entry"
              text={err.msg}
              onClose={() => {
                this.modal("");
              }}
            />
          );
        }
      });
  }
newEntry ( ) { const compDT = new Date ( this . state . date + " " + this . state . time ) . toISOString ( ) ; this . modal ( < LoadingModal text = "Creating New Entry ..." / > ) ; genHours ( this . email , this . state . purpose , this . state . numHours , this . state . paid , compDT ) . then ( success => { this . modal ( "" ) ; this . reload ( ) ; } ) . catch ( err => { console . log ( err ) ; if ( err . stat === 403 ) { this . modal ( < LoadingModal text = { < span > 
                  Your login has expired
                   < br / > 
                  Please reauthenticate
                   < br / > 
                  Singing you out ...
                 < / span > } / > ) ; setTimeout ( ( ) => window . location . reload ( 0 ) , 1000 ) ; } else { this . modal ( < StatusModal title = "Could Not Create New Entry" text = { err . msg } onClose = { ( ) => { this . modal ( "" ) ; } } / > ) ; } } ) ; }
Function for adding a completed new entry
Function for adding a completed new entry
// this.modal("")