-
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #128 from Ignitus/develop
Master > Develop
- Loading branch information
Showing
50 changed files
with
882 additions
and
919 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,11 @@ | ||
eslint: | ||
enabled: true | ||
config_file: .eslintrc | ||
|
||
javscript: | ||
enabled: true | ||
config_file: .jshintrc | ||
|
||
tslint: | ||
enabled: true | ||
config_file: tsconfig.json |
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 @@ | ||
.npmrc |
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,2 @@ | ||
save-exact=true | ||
loglevel=warn |
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 @@ | ||
v13.2.0 |
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 |
---|---|---|
@@ -1,9 +1,10 @@ | ||
module.exports = { | ||
secretKey: process.env.SECRET_KEY, | ||
mongoUrl: process.env.DATABASE_URI, | ||
hashingType: process.env.HASHING_TYPE, | ||
hashingDigest: process.env.HASHING_DIGEST, | ||
privateVapidEmail: process.env.PVT_VAPID_EMAIL, | ||
publicVapidKey: process.env.PUBLIC_VAPID_KEY, | ||
privateVapidKey: process.env.PRIVATE_VAPID_KEY, | ||
export const config = { | ||
secretKey: '3970-582578-4263-184729', | ||
mongoUrl: 'mongodb://ig-migration:[email protected]:47566/ignitus-migration', | ||
hashingType: 'md5', | ||
hashingDigest: 'hex', | ||
privateVapidEmail: '[email protected]', | ||
publicVapidKey: | ||
'BMRATagxJMbZdcX-a-lwaMC93vL7-Kmr3trsTc_g0HJy6C6UGCRMSKfxzJUOjAsXt3W5Ov7t_a8J9y9qROw9mFE', | ||
privateVapidKey: 'NY_nxUlraMagPhmrwco8C-z0QH5xslPSAXP-cFk7cDM', | ||
}; |
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 |
---|---|---|
@@ -1,8 +1,5 @@ | ||
const mongoose = require('mongoose'); | ||
const config = require('./config.js'); | ||
import mongoose from 'mongoose'; | ||
import { config } from './config.js'; | ||
|
||
module.exports = function connectDB() { | ||
return mongoose.connect( | ||
config.mongoUrl, | ||
); | ||
}; | ||
const connectDB = () => mongoose.connect(config.mongoUrl); | ||
export default connectDB; |
This file was deleted.
Oops, something went wrong.
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,65 @@ | ||
/* eslint-disable no-underscore-dangle */ | ||
/* eslint-disable max-len */ | ||
|
||
import Oppurtunity from '../Models/opportunityModel.js'; | ||
import responseHandler from '../Utils/responseHandler.js'; | ||
|
||
export const addOppurtunity = (req, res) => { | ||
Oppurtunity.create(req.body, (err, docs) => { | ||
if (err) { | ||
throw new Error(err); | ||
} | ||
return responseHandler.success(res, docs); | ||
}); | ||
}; | ||
|
||
export const fetchAllOppurtunities = (req, res) => { | ||
Oppurtunity.find({}, (err, docs) => { | ||
if (err) { | ||
throw new Error(err); | ||
} | ||
responseHandler.success(res, docs); | ||
}); | ||
}; | ||
|
||
export const fetchOppurtunityByID = (req, res) => { | ||
Oppurtunity.findById(req.params.id, (err, docs) => { | ||
if (err) { | ||
throw new Error(err); | ||
} | ||
if (!docs) { | ||
return responseHandler.error(res, 'Oppurtunity not found!', 404); | ||
} | ||
return responseHandler.success(res, docs); | ||
}); | ||
}; | ||
|
||
export const updateOppurtunity = (req, res) => { | ||
Oppurtunity.findByIdAndUpdate( | ||
req.params.id, | ||
req.body, | ||
{ new: true }, | ||
(err, docs) => { | ||
if (err) { | ||
throw new Error(err); | ||
} | ||
if (!docs) { | ||
return responseHandler.error(res, 'Oppurtunity not found!', 404); | ||
} | ||
return responseHandler.success(res, docs); | ||
} | ||
); | ||
}; | ||
|
||
export const deleteOppurtunity = (req, res) => { | ||
Oppurtunity.findByIdAndRemove(req.params.id, (err, docs) => { | ||
if (err) { | ||
throw new Error(err); | ||
} | ||
if (!docs) { | ||
return responseHandler.error(res, 'Oppurtunity not found!', 404); | ||
} | ||
// eslint-disable-next-line no-underscore-dangle | ||
return responseHandler.success(res, { _id: docs._id }); | ||
}); | ||
}; |
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,15 @@ | ||
/* eslint-disable max-len */ | ||
import Professor from '../Models/professorModel.js'; | ||
import responseHandler from '../Utils/responseHandler.js'; | ||
|
||
export const professorProfile = (req, res) => { | ||
Professor.find({ email: req.userData.email }, (err, docs) => { | ||
if (err) { | ||
throw new Error(err); | ||
} | ||
if(!docs) { | ||
responseHandler.error(res, 'Profile not found', 404); | ||
} | ||
return responseHandler.success(res, docs); | ||
}); | ||
}; |
This file was deleted.
Oops, something went wrong.
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,14 @@ | ||
import Student from '../Models/studentModel.js'; | ||
import responseHandler from '../Utils/responseHandler.js'; | ||
|
||
export const studentProfile = (req, res) => { | ||
Student.find({ email: req.userData.email }, (err, docs) => { | ||
if (err) { | ||
throw new Error(err); | ||
} | ||
if(!docs) { | ||
responseHandler.error(res, 'Profile not found', 404); | ||
} | ||
return responseHandler.success(res, docs); | ||
}); | ||
}; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,62 @@ | ||
import TeamMember from '../Models/teamMembersModel.js'; | ||
import responseHandler from '../Utils/responseHandler.js'; | ||
|
||
export const fetchAllTeamMembers = (req, res) => { | ||
TeamMember.find({}, (err, docs) => { | ||
if (err) { | ||
throw new Error(err); | ||
} | ||
return responseHandler.success(res, docs); | ||
}); | ||
}; | ||
|
||
export const fetchTeamMemberByID = (req, res) => { | ||
TeamMember.findById(req.params.id, (err, docs) => { | ||
if (err) { | ||
throw new Error(err); | ||
} | ||
if (!docs) { | ||
return responseHandler.error(res, 'TeamMember not found!', 404); | ||
} | ||
return responseHandler.success(res, docs); | ||
}); | ||
}; | ||
|
||
export const createTeamMember = (req, res) => { | ||
TeamMember.create(req.body, (err, docs) => { | ||
if (err) { | ||
throw new Error(err); | ||
} | ||
return responseHandler.success(res, docs); | ||
}); | ||
}; | ||
|
||
export const updateTeamMember = (req, res) => { | ||
TeamMember.findByIdAndUpdate( | ||
req.params.id, | ||
req.body, | ||
{ new: true }, | ||
(err, docs) => { | ||
if (err) { | ||
throw new Error(err); | ||
} | ||
if (!docs) { | ||
return responseHandler.error(res, 'TeamMember not found!', 404); | ||
} | ||
return responseHandler.success(res, docs); | ||
} | ||
); | ||
}; | ||
|
||
export const deleteTeamMember = (req, res) => { | ||
TeamMember.findByIdAndRemove(req.params.id, (err, docs) => { | ||
if (err) { | ||
throw new Error(err); | ||
} | ||
if (!docs) { | ||
return responseHandler.error(res, 'TeamMember not found!', 404); | ||
} | ||
// eslint-disable-next-line no-underscore-dangle | ||
return responseHandler.success(res, { _id: docs._id }); | ||
}); | ||
}; |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.