-
Notifications
You must be signed in to change notification settings - Fork 0
/
NonSwitchCase.txt
43 lines (37 loc) · 1.3 KB
/
NonSwitchCase.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// findOrCreate({where}) find a phone
router.post('/textit/name', function(req, res) {
jobPost.findOne({where: { phone: req.body.phoneNumberFromWebHook}}).then(function(jb){
jb.update({name: req.body.name}).then(function(){
res.json(jb)
});
});
});
router.post('/textit/role', function(req, res) {
jobPost.findOne({where: { phone: req.body.phoneNumberFromWebHook}}).then(function(jb){
jb.update({role: req.body.role}).then(function(){
res.json(jb)
});
});
});
router.post('/textit/location', function(req, res){
jobPost.findOne({where: {phone: req.body.phoneNumberFromWebHook}}).then(function(jb){
jb.update({role: req.body.location}).then(function(){
res.json(jb)
});
});
});
router.post('/textit/skills', function(req, res) {
jobPost.findOne({where: { phone: req.body.phoneNumberFromWebHook}}).then(function(jb){
jb.update({role: req.body.skills}).then(function(){
res.json(jb)
});
});
});
router.post('/textit/hourly', function(req, res) {
jobPost.findOne({where: { phone: req.body.phoneNumberFromWebHook}}).then(function(jb){
jb.update({role: req.body.hourly}).then(function(){
res.json(jb)
});
});
});
//make a special post for each secition