Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // --- code
- loginRoutes.post('/storeLoginTokens', (req, res) => {
- let email = req.param('email');
- let notificationID = req.param('notificationID');
- state.db('User').where('email', '=', email).update({
- notificationID: notificationID
- }).then(function (rows) {
- console.log(rows + " record(s) updated."); // = rows affected
- if (rows === 0) {
- res.status(200).send({
- response: -1
- })
- } else if (rows === 1) {
- res.status(200).send({
- response: 1
- })
- } else {
- res.status(406).send({
- response: -1
- })
- }
- })
- });
- // -- TextRow result
- [ TextRow {
- user_id: 1,
- first_name: 'asdfasdf',
- last_name: 'asdfdsf',
- email: 'asdf@asdfsadf.edu',
- username: 'asfasfas',
- password: '1234',
- date_of_birth: 1996-12-21T05:00:00.000Z,
- lat: 1234,
- long: null,
- notificationID: null } ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement