Skip to content

Commit 3acb3e2

Browse files
committed
add: Get method invite/:email/:userId/:sharedId
1 parent 08b3169 commit 3acb3e2

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

routes/index.js

+19
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,30 @@
11
const express = require('express');
22
const router = express.Router();
3+
const Users = require('../models').users;
4+
const Erds = require('../models').erds;
5+
const ErdCommits = require('../models').erd_commits;
6+
const SharedErds = require('../models').shared_erds;
7+
const SharedUsers = require('../models').shared_users;
8+
const Shared = require('../models').shared;
39

410
/* GET home page. */
511
router.get('/', function (req, res, next) {
612
res.render('index', { title: 'Express' });
713
});
814

15+
router.get('invite/:email/:userId/:sharedId', function (req, res, next) {
16+
const email = req.params.email;
17+
const userId = req.params.userId;
18+
const sharedId = req.params.sharedId;
19+
SharedUsers.create({
20+
user_id:userId,
21+
shared_id:sharedId
22+
}).then(result => {
23+
res.redirect('https://autosql.ga');
24+
})
25+
// res.json({ email: email, userId: userId, sharedId: sharedId });
26+
});
27+
928

1029

1130

0 commit comments

Comments
 (0)