Skip to content

Commit

Permalink
MVP mostly complete aside from heroku issues
Browse files Browse the repository at this point in the history
theiseja committed May 3, 2019
1 parent b53ae7c commit 2ac2bb1
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion database/migrations/20190424212758_createTodosTable.js
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ exports.up = function(knex, Promise) {
tbl.integer('userId')
.unsigned()
.references('id')
.inTable('users'); // user id that the note belongs
.inTable('users'); // user id that the note belongs to
tbl.boolean('completed'); // completed y/n
tbl.timestamps(true, true); // timestamps
})
5 changes: 1 addition & 4 deletions routes/todoRoutes.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
const router = require('express').Router();
const database = require('../database/dbConfig');

router.get('/', async (req, res) => {

})

// GET all todos
router.get('/list', async (req, res) => {
const todo = await database('todos').where('userId', req.decoded.subject);
try {
const todo = await database('todos').where('userId', req.decoded.subject);
console.log(req.decoded.subject)
res.status(200).json(todo)
} catch (error) {

0 comments on commit 2ac2bb1

Please sign in to comment.