unifies Buy and Sell parameters
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
use actix_cors::Cors;
|
||||
use actix_files as fs;
|
||||
use actix_web::{web, middleware, App, Error, HttpResponse, HttpServer, Either};
|
||||
use futures::{Future, IntoFuture};
|
||||
use futures::{Future};
|
||||
use std::env;
|
||||
|
||||
use lootalot_db as db;
|
||||
@@ -98,7 +98,7 @@ fn configure_app(config: &mut web::ServiceConfig) {
|
||||
db_call(pool, Q::FetchLoot(*player))
|
||||
}))
|
||||
.route(web::put().to_async(
|
||||
move |pool, (player, data): (PlayerId, web::Json<api::ItemListWithMods>)| {
|
||||
move |pool, (player, data): (PlayerId, web::Json<api::BuySellParams>)| {
|
||||
db_call(pool, Q::BuyItems(*player, data.into_inner()))
|
||||
},
|
||||
))
|
||||
@@ -108,7 +108,7 @@ fn configure_app(config: &mut web::ServiceConfig) {
|
||||
},
|
||||
))
|
||||
.route(web::delete().to_async(
|
||||
move |pool, (player, data): (PlayerId, web::Json<api::SellParams>)| {
|
||||
move |pool, (player, data): (PlayerId, web::Json<api::BuySellParams>)| {
|
||||
db_call(pool, Q::SellItems(*player, data.into_inner()))
|
||||
},
|
||||
)),
|
||||
|
||||
Reference in New Issue
Block a user