Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated Model #2

Open
wants to merge 1 commit into
base: solution3a
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 14 additions & 39 deletions model/task.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,43 +37,18 @@ module.exports = {
})
.catch(error => next(error));
},

// /* PUT /tasks/:taskID */
// updateTask(req, res, next) {
// // tID is invented here
// req.body.tID = Number.parseInt(req.params.taskID);
// req.body.completed = !!req.body.completed;

// db.one(
// `UPDATE task SET
// name = $/name/,
// description = $/description/,
// completed = $/completed/,
// WHERE id = $/tID/
// returning *; `,
// req.body)

// .then((task) => {
// console.log('ADDED UPDATED SUCCESSFULLY');
// res.rows = task;
// next();
// })
// .catch(error => next(error));
// },

// /* DELETE /tasks/:id */
// deleteTask(req, res, next) {
// req.body.tID = Number.parseInt(req.params.taskID);

// db.none(`
// DELETE FROM task
// WHERE id = $1
// `, [req.body.tID])

// .then(() => {
// console.log('DELETE COMPLETED');
// next();
// })
// .catch(error => next(error));
// },
getALife(req,res,next) {
console.log('who makes their own to do list??');
console.log('who stalks people on github??');
db.none(`
SELECT the_point FROM life
WHERE name = $1;
`, ['Jason Seminara'])
.then(life => {
console.log('why am i doing this')
res.pointless = life;
next()
})
.catch(life => next(who_cares)); //also removed ur comments b/c those things are pointless
},
}