Skip to content

Comments

Dev#61

Open
TheStaches wants to merge 15 commits intomasterfrom
dev
Open

Dev#61
TheStaches wants to merge 15 commits intomasterfrom
dev

Conversation

@TheStaches
Copy link

No description provided.

Mank858 and others added 9 commits September 27, 2018 14:13
* adds multiple admin accounts

* corrects variables

* changes bootscript
* sets up remove apt button

* sends email to user/admin
* changes apt request approve function

* changes aptRequests
* changes apt request approve function

* changes aptRequests

* changes time to display correctly in admin availability
* saving current stuff

* made individual instructor pages and created e2e tests

* made some changes to the circle config

* changed start script

* changed start script

* added run build in the test script

* imported moment package

* made changes to nightmare test, created a student user, made changes individaul instructors components

* added nightmare tests and deletes requested options from state

* saving current stuff

* made individual instructor pages and created e2e tests

* made some changes to the circle config

* changed start script

* changed start script

* added run build in the test script

* imported moment package

* made changes to nightmare test, created a student user, made changes individaul instructors components

* added nightmare tests and deletes requested options from state
* adds multiple admin accounts

* corrects variables

* changes bootscript

* Adds remove appointment on pending apppointment

* adds instructor availability delete functionality

* Deletes Slot and send email to pending request students

* Fixes delete button

* fixes delete button

* fixes merge conflicts

* adds instructor availability delete functionality

* fixes merge conflict

* Fixes delete button

* fixes merge conflict

* Adds remove appointment on pending apppointment

* adds instructor availability delete functionality

* Deletes Slot and send email to pending request students

* Fixes delete button

* fixes delete button

* fixes merge conflicts

* adds instructor availability delete functionality

* fixes merge conflict

* fixes instructor names

* fixes merge conflict
* adds multiple admin accounts

* corrects variables

* changes bootscript

* sets up remove apt button

* sends email to user/admin

* trash icon

* new button

* sets up remove apt button

* sends email to user/admin

* trash icon

* new button
* adds multiple admin accounts

* corrects variables

* changes bootscript

* Sends instructor email on appointment request

* Setting up google calendar

* Merging conflicts

* Merging conflicts

* Routing api code to remote method

* Routing api code to remote method

* adds token to user model

* Adds token to user model

* Gets auth token for admin when logging in

* fixes authorize

* sets auth tokens to user models and refreshes token on login

* Sends instructor email on appointment request

* Setting up google calendar

* Merging conflicts

* Merging conflicts

* Routing api code to remote method

* Routing api code to remote method

* adds token to user model

* Adds token to user model

* Gets auth token for admin when logging in

* fixes authorize

* sets auth tokens to user models and refreshes token on login

* fixes merge conflicts

* fixes merge conflicts

* changes approve function and deletes extra googleAuth

* Fixes emailAdmin on pending appointment

* fixes rendering pending appointments

* fixes merge issues

* fixes merge issues

* Merging conflicts

* fixes merge issues

* Routing api code to remote method

* fixes merge issues

* fixes merge issues

* fixes merge issues

* Gets auth token for admin when logging in

* fixes authorize

* fixes merge issues

* fixes merge issues

* Merging conflicts

* Merging conflicts

* fixes merge issues

* fixes merge issues

* fixes merge issues

* fixes merge issues

* fixes merge issues

* fixes merge issues

* sets auth tokens to user models and refreshes token on login

* fixes merge issues

* changes approve function and deletes extra googleAuth

* fixes emailAdmin

* fixes pendingAppointments
* removed confirmed apts

* removed confirmed apts
};

BookedApt.remoteMethod('removedConfirmed', {
accepts: [{arg: 'email', type: 'string', required: true},

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar blocks of code found in 2 locations. Consider refactoring.

};

Aptrequest.remoteMethod('emailAdmin', {
accepts: [{arg: 'instructorEmail', type: 'string', required: true},

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar blocks of code found in 2 locations. Consider refactoring.

<td>{e.issueDescription}</td>
<td>{moment(e.time).format('L')}</td>
<td>{moment(e.time).format('hh:mm a')}</td>
<td>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar blocks of code found in 2 locations. Consider refactoring.

<td>{moment(e.timeSlot).format('L')}</td>
<td>{moment(e.timeSlot).format('hh:mm a')}</td>
<td>{e.duration}</td>
<td>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar blocks of code found in 2 locations. Consider refactoring.

});
};

Visitor.remoteMethod('oAuthConfirm', {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar blocks of code found in 2 locations. Consider refactoring.

const instructorEmail = `${this.state.selectedSlot.instructorId}@origincodeacademy.com`
const time = this.state.time;
const studentName = (this.props.user.firstName + ' ' + this.props.user.lastName);
axios.post(`/api/AptRequests/emailAdmin`, {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identical blocks of code found in 4 locations. Consider refactoring.

const instructorEmail = `${this.state.selectedSlot.instructorId}@origincodeacademy.com`
const time = this.state.time;
const studentName = (this.props.user.firstName + ' ' + this.props.user.lastName);
axios.post(`/api/AptRequests/emailAdmin`, {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identical blocks of code found in 4 locations. Consider refactoring.

const instructorEmail = `${this.state.selectedSlot.instructorId}@origincodeacademy.com`
const time = this.state.time;
const studentName = (this.props.user.firstName + ' ' + this.props.user.lastName);
axios.post(`/api/AptRequests/emailAdmin`, {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identical blocks of code found in 4 locations. Consider refactoring.

})
}

handleTimeSlot(e) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identical blocks of code found in 2 locations. Consider refactoring.

});
});
});
Visitor.findOrCreate({

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar blocks of code found in 4 locations. Consider refactoring.

@@ -0,0 +1 @@
google-site-verification: googlef392b883fe8ce677.html No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this file

});
});
});
Visitor.findOrCreate({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These functions should be condensed into some sort of loop

{ this.state.user && (this.state.isAdmin === false) ?
<li className="nav-item">
<Link to="/request">Request</Link>
<Link id='reqtest' to="/request" >Request</Link>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this supposed to be request?

.then(res => {
res.data.map(request => {
axios.delete(`/api/AptRequests/${request.id}`)
axios.post(`/api/AptRequests/denyEmail`, {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Posting the deny email should come after the DELETE request has been fulfilled. Throw this POST request within a .then of the previous request

time: time,
})
.then(function (response) {
console.log(response);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove superfluous console.log(s) from client side

import SignIn from '../SignIn';
import Request from '../Request';
import Availability from '../AdminAvailability';
import Christianviews from '../Request/Christianview';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These files are essentially the same. Condense the three components into one and pass down differences through props

const instructorEmail = `${this.state.selectedSlot.instructorId}@origincodeacademy.com`
const time = this.state.time;
const studentName = (this.props.user.firstName + ' ' + this.props.user.lastName);
axios.post(`/api/AptRequests/emailAdmin`, {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This request should go inside the .then of the previous axios.post. We should expect that the request was successful before getting an email about it

time: time,
studentName: studentName,
})
.then()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this .then

chai.use(chaiHttp);
const expect = chai.expect;

const path = 'http://localhost:8080' || process.env.PORT;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This string will always be truthy, so it will never take process.env.PORT (which isn't needed in your test). Change this line to just the string

chai.use(chaiHttp);
const expect = chai.expect;

const url = 'http://localhost:8080' || process.env.PORT;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line isn't needed

import moment from 'moment';

export default class Anthonyview extends react.Component{
constructor(props){

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identical blocks of code found in 2 locations. Consider refactoring.

const instructorEmail = `${this.state.selectedSlot.instructorId}@origincodeacademy.com`
const time = this.state.time;
const studentName = (this.props.user.firstName + ' ' + this.props.user.lastName);
axios.post(`/api/AptRequests/emailAdmin`, {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identical blocks of code found in 2 locations. Consider refactoring.

const instructorEmail = `${this.state.selectedSlot.instructorId}@origincodeacademy.com`
const time = this.state.time;
const studentName = (this.props.user.firstName + ' ' + this.props.user.lastName);
axios.post(`/api/AptRequests/emailAdmin`, {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identical blocks of code found in 2 locations. Consider refactoring.

}

handleSubmit(e) {
axios.post(`/api/Visitors/${this.props.user.id}/aptRequests`, {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar blocks of code found in 2 locations. Consider refactoring.

}

handleSubmit(e) {
axios.post(`/api/Visitors/${this.props.user.id}/aptRequests`, {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar blocks of code found in 2 locations. Consider refactoring.

})
}

handleSubmit(e) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function handleSubmit has 41 lines of code (exceeds 25 allowed). Consider refactoring.




render(){

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function render has 27 lines of code (exceeds 25 allowed). Consider refactoring.


}

handleSubmit(e) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function handleSubmit has 40 lines of code (exceeds 25 allowed). Consider refactoring.

"slotId": this.state.slotId,
"instructorId": "anthony"
}).then((response) => {
axios.post(`/api/AptRequests/emailAdmin`, {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identical blocks of code found in 2 locations. Consider refactoring.

const instructorEmail = `${this.state.selectedSlot.instructorId}@origincodeacademy.com`
const time = this.state.time;
const studentName = (this.props.user.firstName + ' ' + this.props.user.lastName);
axios.post(`/api/AptRequests/emailAdmin`, {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identical blocks of code found in 2 locations. Consider refactoring.

import moment from 'moment';

export default class Anthonyview extends react.Component{
constructor(props){

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identical blocks of code found in 2 locations. Consider refactoring.

const instructorEmail = `${this.state.selectedSlot.instructorId}@origincodeacademy.com`
const time = this.state.time;
const studentName = (this.props.user.firstName + ' ' + this.props.user.lastName);
axios.post(`/api/AptRequests/emailAdmin`, {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identical blocks of code found in 2 locations. Consider refactoring.

const instructorEmail = `${this.state.selectedSlot.instructorId}@origincodeacademy.com`
const time = this.state.time;
const studentName = (this.props.user.firstName + ' ' + this.props.user.lastName);
axios.post(`/api/AptRequests/emailAdmin`, {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identical blocks of code found in 2 locations. Consider refactoring.

}

handleSubmit(e) {
axios.post(`/api/Visitors/${this.props.user.id}/aptRequests`, {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar blocks of code found in 2 locations. Consider refactoring.

}

handleSubmit(e) {
axios.post(`/api/Visitors/${this.props.user.id}/aptRequests`, {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar blocks of code found in 2 locations. Consider refactoring.

})
}

handleSubmit(e) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function handleSubmit has 41 lines of code (exceeds 25 allowed). Consider refactoring.




render(){

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function render has 27 lines of code (exceeds 25 allowed). Consider refactoring.


}

handleSubmit(e) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function handleSubmit has 40 lines of code (exceeds 25 allowed). Consider refactoring.

"slotId": this.state.slotId,
"instructorId": "anthony"
}).then((response) => {
axios.post(`/api/AptRequests/emailAdmin`, {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identical blocks of code found in 2 locations. Consider refactoring.

const instructorEmail = `${this.state.selectedSlot.instructorId}@origincodeacademy.com`
const time = this.state.time;
const studentName = (this.props.user.firstName + ' ' + this.props.user.lastName);
axios.post(`/api/AptRequests/emailAdmin`, {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identical blocks of code found in 2 locations. Consider refactoring.

import moment from 'moment';

export default class Anthonyview extends react.Component{
constructor(props){

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identical blocks of code found in 2 locations. Consider refactoring.

const instructorEmail = `${this.state.selectedSlot.instructorId}@origincodeacademy.com`
const time = this.state.time;
const studentName = (this.props.user.firstName + ' ' + this.props.user.lastName);
axios.post(`/api/AptRequests/emailAdmin`, {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identical blocks of code found in 2 locations. Consider refactoring.

const instructorEmail = `${this.state.selectedSlot.instructorId}@origincodeacademy.com`
const time = this.state.time;
const studentName = (this.props.user.firstName + ' ' + this.props.user.lastName);
axios.post(`/api/AptRequests/emailAdmin`, {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identical blocks of code found in 2 locations. Consider refactoring.

}

handleSubmit(e) {
axios.post(`/api/Visitors/${this.props.user.id}/aptRequests`, {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar blocks of code found in 2 locations. Consider refactoring.

}

handleSubmit(e) {
axios.post(`/api/Visitors/${this.props.user.id}/aptRequests`, {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar blocks of code found in 2 locations. Consider refactoring.

})
}

handleSubmit(e) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function handleSubmit has 41 lines of code (exceeds 25 allowed). Consider refactoring.




render(){

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function render has 27 lines of code (exceeds 25 allowed). Consider refactoring.


}

handleSubmit(e) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function handleSubmit has 40 lines of code (exceeds 25 allowed). Consider refactoring.

"slotId": this.state.slotId,
"instructorId": "anthony"
}).then((response) => {
axios.post(`/api/AptRequests/emailAdmin`, {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identical blocks of code found in 2 locations. Consider refactoring.

const instructorEmail = `${this.state.selectedSlot.instructorId}@origincodeacademy.com`
const time = this.state.time;
const studentName = (this.props.user.firstName + ' ' + this.props.user.lastName);
axios.post(`/api/AptRequests/emailAdmin`, {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identical blocks of code found in 2 locations. Consider refactoring.

import moment from 'moment';

export default class Anthonyview extends react.Component{
constructor(props){

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identical blocks of code found in 2 locations. Consider refactoring.

const instructorEmail = `${this.state.selectedSlot.instructorId}@origincodeacademy.com`
const time = this.state.time;
const studentName = (this.props.user.firstName + ' ' + this.props.user.lastName);
axios.post(`/api/AptRequests/emailAdmin`, {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identical blocks of code found in 2 locations. Consider refactoring.

const instructorEmail = `${this.state.selectedSlot.instructorId}@origincodeacademy.com`
const time = this.state.time;
const studentName = (this.props.user.firstName + ' ' + this.props.user.lastName);
axios.post(`/api/AptRequests/emailAdmin`, {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identical blocks of code found in 2 locations. Consider refactoring.

}

handleSubmit(e) {
axios.post(`/api/Visitors/${this.props.user.id}/aptRequests`, {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar blocks of code found in 2 locations. Consider refactoring.

}

handleSubmit(e) {
axios.post(`/api/Visitors/${this.props.user.id}/aptRequests`, {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar blocks of code found in 2 locations. Consider refactoring.

})
}

handleSubmit(e) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function handleSubmit has 41 lines of code (exceeds 25 allowed). Consider refactoring.




render(){

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function render has 27 lines of code (exceeds 25 allowed). Consider refactoring.


}

handleSubmit(e) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function handleSubmit has 40 lines of code (exceeds 25 allowed). Consider refactoring.

"slotId": this.state.slotId,
"instructorId": "anthony"
}).then((response) => {
axios.post(`/api/AptRequests/emailAdmin`, {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identical blocks of code found in 2 locations. Consider refactoring.

const instructorEmail = `${this.state.selectedSlot.instructorId}@origincodeacademy.com`
const time = this.state.time;
const studentName = (this.props.user.firstName + ' ' + this.props.user.lastName);
axios.post(`/api/AptRequests/emailAdmin`, {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identical blocks of code found in 2 locations. Consider refactoring.

import moment from 'moment';

export default class Anthonyview extends react.Component{
constructor(props){

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identical blocks of code found in 2 locations. Consider refactoring.

const instructorEmail = `${this.state.selectedSlot.instructorId}@origincodeacademy.com`
const time = this.state.time;
const studentName = (this.props.user.firstName + ' ' + this.props.user.lastName);
axios.post(`/api/AptRequests/emailAdmin`, {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identical blocks of code found in 2 locations. Consider refactoring.

const instructorEmail = `${this.state.selectedSlot.instructorId}@origincodeacademy.com`
const time = this.state.time;
const studentName = (this.props.user.firstName + ' ' + this.props.user.lastName);
axios.post(`/api/AptRequests/emailAdmin`, {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identical blocks of code found in 2 locations. Consider refactoring.

}

handleSubmit(e) {
axios.post(`/api/Visitors/${this.props.user.id}/aptRequests`, {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar blocks of code found in 2 locations. Consider refactoring.

}

handleSubmit(e) {
axios.post(`/api/Visitors/${this.props.user.id}/aptRequests`, {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar blocks of code found in 2 locations. Consider refactoring.

})
}

handleSubmit(e) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function handleSubmit has 41 lines of code (exceeds 25 allowed). Consider refactoring.




render(){

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function render has 27 lines of code (exceeds 25 allowed). Consider refactoring.


}

handleSubmit(e) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function handleSubmit has 40 lines of code (exceeds 25 allowed). Consider refactoring.

"slotId": this.state.slotId,
"instructorId": "anthony"
}).then((response) => {
axios.post(`/api/AptRequests/emailAdmin`, {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identical blocks of code found in 2 locations. Consider refactoring.

const instructorEmail = `${this.state.selectedSlot.instructorId}@origincodeacademy.com`
const time = this.state.time;
const studentName = (this.props.user.firstName + ' ' + this.props.user.lastName);
axios.post(`/api/AptRequests/emailAdmin`, {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identical blocks of code found in 2 locations. Consider refactoring.

import moment from 'moment';

export default class Anthonyview extends react.Component{
constructor(props){

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identical blocks of code found in 2 locations. Consider refactoring.

const instructorEmail = `${this.state.selectedSlot.instructorId}@origincodeacademy.com`
const time = this.state.time;
const studentName = (this.props.user.firstName + ' ' + this.props.user.lastName);
axios.post(`/api/AptRequests/emailAdmin`, {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identical blocks of code found in 2 locations. Consider refactoring.

const instructorEmail = `${this.state.selectedSlot.instructorId}@origincodeacademy.com`
const time = this.state.time;
const studentName = (this.props.user.firstName + ' ' + this.props.user.lastName);
axios.post(`/api/AptRequests/emailAdmin`, {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identical blocks of code found in 2 locations. Consider refactoring.

}

handleSubmit(e) {
axios.post(`/api/Visitors/${this.props.user.id}/aptRequests`, {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar blocks of code found in 2 locations. Consider refactoring.

}

handleSubmit(e) {
axios.post(`/api/Visitors/${this.props.user.id}/aptRequests`, {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar blocks of code found in 2 locations. Consider refactoring.

})
}

handleSubmit(e) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function handleSubmit has 41 lines of code (exceeds 25 allowed). Consider refactoring.




render(){

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function render has 27 lines of code (exceeds 25 allowed). Consider refactoring.


}

handleSubmit(e) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function handleSubmit has 40 lines of code (exceeds 25 allowed). Consider refactoring.

"slotId": this.state.slotId,
"instructorId": "anthony"
}).then((response) => {
axios.post(`/api/AptRequests/emailAdmin`, {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identical blocks of code found in 2 locations. Consider refactoring.

const instructorEmail = `${this.state.selectedSlot.instructorId}@origincodeacademy.com`
const time = this.state.time;
const studentName = (this.props.user.firstName + ' ' + this.props.user.lastName);
axios.post(`/api/AptRequests/emailAdmin`, {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identical blocks of code found in 2 locations. Consider refactoring.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants