resources/resourcesModel.js
// TODO: Single resource by name for a user
Single resource by name for a user
Single resource by name for a user
function resourceByName(user_id, resource_name) {
  return db("resources as r")
    .select(
      "u.id as user_id",
      "u.username",
      "r.id as resource_id",
      "r.name",
      "r.link",
      "r.status",
      "r.last_check"
    )
    .join("users as u", "u.id", "r.user_id")
    .where("user_id", user_id)
    .where("r.name", resource_name);
}
function resourceByName ( user_id , resource_name ) { return db ( "resources as r" ) . select ( "u.id as user_id" , "u.username" , "r.id as resource_id" , "r.name" , "r.link" , "r.status" , "r.last_check" ) . join ( "users as u" , "u.id" , "r.user_id" ) . where ( "user_id" , user_id ) . where ( "r.name" , resource_name ) ; }
TODO: Single resource by name for a user
TODO : Single resource by name for a user