fixes bug (float precision) by using f64
This commit is contained in:
@@ -10,7 +10,7 @@ use crate::api;
|
||||
type AppPool = web::Data<db::Pool>;
|
||||
type PlayerId = web::Path<i32>;
|
||||
type ItemId = web::Json<i32>;
|
||||
type ItemListWithMods = web::Json<Vec<(i32, Option<f32>)>>;
|
||||
type ItemListWithMods = web::Json<Vec<(i32, Option<f64>)>>;
|
||||
|
||||
/// Wraps call to the database query and convert its result as a async HttpResponse
|
||||
pub fn db_call(
|
||||
@@ -65,7 +65,7 @@ fn configure_app(config: &mut web::ServiceConfig) {
|
||||
web::resource("/wealth")
|
||||
//.route(web::get().to_async(...))
|
||||
.route(web::put().to_async(
|
||||
|pool, (player, data): (PlayerId, web::Json<f32>)| {
|
||||
|pool, (player, data): (PlayerId, web::Json<f64>)| {
|
||||
db_call(
|
||||
pool,
|
||||
Q::UpdateWealth(*player, *data),
|
||||
|
||||
Reference in New Issue
Block a user