uses tips from diesel.rs guide for application integration
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
use actix_web::{web, web::Json, Error, HttpResponse, Result};
|
||||
use futures::Future;
|
||||
|
||||
use lootalot_db::{Pool, DbConnection, QueryResult, ActionResult};
|
||||
use lootalot_db::{RunQueryDsl, Pool, DbConnection, QueryResult, ActionResult};
|
||||
use lootalot_db::{Item, Player};
|
||||
|
||||
/// A wrapper providing an API over the database
|
||||
@@ -49,7 +49,7 @@ pub struct AsPlayer<'q> {
|
||||
impl<'q> AsPlayer<'q> {
|
||||
/// Fetch the content of a player's chest
|
||||
pub fn loot(self) -> QueryResult<Vec<Item>> {
|
||||
Player::fetch_loot(self.id, self.conn)
|
||||
dbg!( Ok( Item::owned_by(self.id).load(self.conn)? ) )
|
||||
}
|
||||
/// Put a claim on a specific item
|
||||
pub fn claim(self, item: i32) -> ActionResult {
|
||||
|
||||
Reference in New Issue
Block a user