- getOne: function(id, cb)
- {
- db.serialize(function() {
- const query =
- "SELECT * " +
- "FROM Challenges " +
- "WHERE id = " + id;
- db.get(query, (err,challenge) => {
- return cb(err, challenge);
- });
- });
- },
-
- // All challenges except where target is defined and not me,
- // and I'm not the sender.
- getByUser: function(uid, cb)
- {
+ // All challenges related to user with ID uid
+ getByUser: function(uid, cb) {