This repository has been archived by the owner on Sep 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feedback and GHC Signups are now stored in a DB, not files.
- Loading branch information
Showing
7 changed files
with
167 additions
and
6 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
const Feedback = require('../models/feedback'); | ||
let TYPE = 'Feedback'; | ||
|
||
class AccessFeedback { | ||
constructor() { | ||
this.addFeedback = addFeedback; | ||
} | ||
} | ||
|
||
let access_signup = module.exports = exports = new AccessFeedback(); | ||
|
||
|
||
/******************************** | ||
* C.R.U.D. FUNCTIONS | ||
*******************************/ | ||
function addFeedback(name, entity, email, rating, message, intention, callback) { | ||
let newFeedback = new Feedback({ | ||
name: name, | ||
entity: entity, | ||
email: email, | ||
rating: rating, | ||
message: message, | ||
intention: intention | ||
}); | ||
|
||
newFeedback.save(callback); | ||
|
||
} |
This file contains 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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
const Signup = require('../models/signup'); | ||
const Utils = require('./utils-accesses'); | ||
let TYPE = 'Signup'; | ||
|
||
class AccessSignup { | ||
constructor() { | ||
this.addPreSignup = addPreSignup; | ||
} | ||
} | ||
|
||
let access_signup = module.exports = exports = new AccessSignup(); | ||
|
||
|
||
/******************************** | ||
* C.R.U.D. FUNCTIONS | ||
*******************************/ | ||
function addPreSignup(teamName, teamCaptain, teamContactEmail, teamContactPhone, participantsNumber, newsletter, EmailIST, callback) { | ||
let newSignup = new Signup({ | ||
teamName: teamName, | ||
teamCaptain: teamCaptain, | ||
teamContactEmail: teamContactEmail, | ||
teamContactPhone: teamContactPhone, | ||
participantsNumber: participantsNumber, | ||
newsletter: newsletter, | ||
EmailIST: EmailIST | ||
}); | ||
|
||
newSignup.save(callback); | ||
|
||
} |
This file contains 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 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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
const mongoose = require('mongoose'); | ||
|
||
// User Schema - Abstract | ||
|
||
const FeedbackSchema = mongoose.Schema({ | ||
entity: { | ||
type: String, | ||
required: true | ||
}, | ||
intention: { | ||
type: String, | ||
required: true | ||
}, | ||
rating: { | ||
type: Number, | ||
required: true | ||
}, | ||
name: { | ||
type: String, | ||
required: true | ||
}, | ||
email: { | ||
type: String, | ||
required: true | ||
}, | ||
message: { | ||
type: String, | ||
required: true, | ||
} | ||
}); | ||
|
||
const Feedback = module.exports = mongoose.model('Feedback', FeedbackSchema); |
This file contains 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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
const mongoose = require('mongoose'); | ||
|
||
// User Schema - Abstract | ||
|
||
const SignupSchema = mongoose.Schema({ | ||
teamName: { | ||
type: String, | ||
required: true | ||
}, | ||
teamCaptain: { | ||
type: String, | ||
required: true | ||
}, | ||
teamContactEmail: { | ||
type: String, | ||
required: true | ||
}, | ||
teamContactPhone: { | ||
type: String, | ||
required: false | ||
}, | ||
EmailIST: { | ||
type: String, | ||
required: true | ||
}, | ||
participantsNumber: { | ||
type: String, | ||
required: true | ||
}, | ||
newsletter: { | ||
type: Boolean, | ||
required: true, | ||
} | ||
}); | ||
|
||
const Feedback = module.exports = mongoose.model('Signup', SignupSchema); |
This file contains 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 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