This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ---------------------------------------------------------------------------- # | |
# Standard setup stuff. In general you will want to alter the formatters | |
# | |
[formatters] | |
keys: detailed,simple | |
[handlers] | |
keys: console | |
[formatter_simple] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import db from '../database'; | |
class Item { | |
static fetch(user_id) { | |
return // make sure you return the promise so it can be seen by the outer method! | |
db.query("select * from items where user_id = $1", user_id) | |
.then(function (result) { | |
// This result object obvs comes from the $promise.resolve(result); that would happen within query. | |
// Lets pretend result is the string "Hello world" | |
console.log(result); |