-
Notifications
You must be signed in to change notification settings - Fork 0
Dev #61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
TheStaches
wants to merge
15
commits into
master
Choose a base branch
from
dev
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Dev #61
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
d166e0d
Dje multiple admins (#45)
Mank858 f548cbf
Kw (#49)
30596d9
Dje cal 17 (#53)
Mank858 81ed43d
Dje cal 12 (#55)
Mank858 7115d8a
Testbranchtl (#58)
94d74cc
Ebd slot delete (#54)
TheStaches 7e40173
Kw (#57)
5c1951a
Ebd admin sendgrid (#59)
TheStaches 0c948a3
removed confirmed apts (#60)
4ab8b26
fixes code climate issues
TheStaches f481480
Fixes tests
TheStaches 8ebdc51
Fixes tests
TheStaches 3e0501f
Fixes tests
TheStaches 37f9cf8
fixes testing issues
TheStaches 3ea022d
updating tests
TheStaches File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,44 +1,86 @@ | ||
| 'use strict'; | ||
|
|
||
| require('dotenv').config(); | ||
|
|
||
| module.exports = (app) => { | ||
| const {Visitor, Role, RoleMapping} = app.models; | ||
| Visitor.findOrCreate({ | ||
| where: { | ||
| email: 'instructor@origincodeacademy.com', | ||
| }, | ||
| }, | ||
|
|
||
| const instructors = [ | ||
| { | ||
| email: 'instructor@origincodeacademy.com', | ||
| firstName: 'John', | ||
| lastName: 'Doe', | ||
| password: process.env.ADMIN_PASSWORD, | ||
| emailVerified: true, | ||
| }, | ||
| (err, visitor) => { | ||
| if (err) console.log(err); | ||
| Role.findOrCreate({ | ||
| where: { | ||
| name: 'ADMIN', | ||
| }, | ||
| { | ||
| email: 'anthony@origincodeacademy.com', | ||
| firstName: 'Anthony', | ||
| lastName: 'Valera', | ||
| password: process.env.ADMIN_PASSWORD, | ||
| }, | ||
| { | ||
| email: 'christian@origincodeacademy.com', | ||
| firstName: 'Christian', | ||
| lastName: 'McFarland', | ||
| password: process.env.ADMIN_PASSWORD2, | ||
| }, | ||
| { | ||
| email: 'michael@origincodeacademy.com', | ||
| firstName: 'Michael', | ||
| lastName: 'Roberts', | ||
| password: process.env.ADMIN_PASSWORD3, | ||
| }, | ||
| ]; | ||
|
|
||
| instructors.forEach(({email, firstName, lastName, password}) => { | ||
| Visitor.findOrCreate({ | ||
| where: { | ||
| email, | ||
| }, | ||
| }, | ||
| { | ||
| email, | ||
| firstName, | ||
| lastName, | ||
| password, | ||
| emailVerified: true, | ||
| authToken: {}, | ||
| }, | ||
| { | ||
| name: 'ADMIN', | ||
| (err, visitor) => { | ||
| Role.findOrCreate({ | ||
| where: { | ||
| name: 'ADMIN', | ||
| }, | ||
| }, | ||
| (err, role) => { | ||
| if (err) console.log('error creating role', err); | ||
| RoleMapping.findOrCreate({ | ||
| where: { | ||
| principalType: 'ADMIN', | ||
| }, | ||
| { | ||
| name: 'ADMIN', | ||
| }, | ||
| { | ||
| principalType: 'ADMIN', | ||
| principalId: visitor.id, | ||
| }, (error, mapping) => { | ||
| if (err) console.log(err); | ||
| }); | ||
| }); | ||
| (err, role) => { | ||
| if (err) console.log('error creating role', err); | ||
| RoleMapping.findOrCreate({ | ||
| where: { | ||
| principalType: 'ADMIN', | ||
| principalId: visitor.id, | ||
| }, | ||
| }, | ||
| { | ||
| principalType: 'ADMIN', | ||
| principalId: visitor.id, | ||
| }, (error, mapping) => { | ||
| if (err) console.log(err); | ||
| }); | ||
| }); | ||
| }); | ||
| }); | ||
|
|
||
| Visitor.findOrCreate({ | ||
| where: { | ||
| email: 'student@origincodeacademy.com', | ||
| }, | ||
| }, | ||
| { | ||
| email: 'student@origincodeacademy.com', | ||
| firstName: 'Student', | ||
| lastName: 'Studentson', | ||
| password: 'abc123', | ||
| emailVerified: true, | ||
| }); | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,30 @@ | ||
| 'use strict'; | ||
| const moment = require('moment'); | ||
|
|
||
| module.exports = function(Bookedapt) { | ||
| module.exports = function(BookedApt) { | ||
|
|
||
|
|
||
| BookedApt.removedConfirmed = function(email, time, studentName, cb) { | ||
| BookedApt.app.models.Email.send({ | ||
| to: email, | ||
| from: 'instructor@origincodeacademy.com', | ||
| subject: ' Confirmed Appointment Removed', | ||
| text: `Your appointment on ${moment(time).format('L')} | ||
| at ${moment(time).format('hh:mm a')} was removed${studentName}`, | ||
| }, function(err, mail) { | ||
| if (err) console.log(err); | ||
| return cb(null, mail); | ||
| }); | ||
| }; | ||
|
|
||
| BookedApt.remoteMethod('removedConfirmed', { | ||
| accepts: [{arg: 'email', type: 'string', required: true}, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similar blocks of code found in 2 locations. Consider refactoring. |
||
| {arg: 'time', type: 'string', required: true}, | ||
| {arg: 'studentName', type: 'string', required: true}], | ||
| http:{path:'/removedConfirmed', verb:'post'}, | ||
| returns: {arg: 'res', type: 'Object'}, | ||
| }); | ||
|
|
||
|
|
||
|
|
||
| }; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.