impls wealth updating
This commit is contained in:
@@ -62,6 +62,13 @@ pub(crate) fn serve() -> std::io::Result<()> {
|
||||
db_call(pool, move |api| api.fetch_players())
|
||||
}),
|
||||
)
|
||||
.route(
|
||||
"/update-wealth/{player_id}/{amount}",
|
||||
web::get().to_async(move |pool: AppPool, data: web::Path<(i32, f32)>| {
|
||||
let (player, gold) = *data;
|
||||
db_call(pool, move |api| api.as_player(player).update_wealth(gold))
|
||||
}),
|
||||
)
|
||||
.route(
|
||||
"/loot/{player_id}",
|
||||
web::get().to_async(move |pool: AppPool, player_id: web::Path<i32>| {
|
||||
|
||||
Reference in New Issue
Block a user