aboutsummaryrefslogtreecommitdiff
path: root/planetwars-server/src/routes/bots.rs
diff options
context:
space:
mode:
authorIlion Beyst <ilion.beyst@gmail.com>2022-07-23 23:40:25 +0200
committerIlion Beyst <ilion.beyst@gmail.com>2022-07-23 23:40:25 +0200
commit4a582e8079178a7ac11f2a492e7988fcdaa210cd (patch)
tree1403b3e409e184bb53e0349d7e68e673fe7d7b3c /planetwars-server/src/routes/bots.rs
parentf19a70e710b8bf4605625516aa7e4c0cc7ace2e4 (diff)
downloadplanetwars.dev-4a582e8079178a7ac11f2a492e7988fcdaa210cd.tar.xz
planetwars.dev-4a582e8079178a7ac11f2a492e7988fcdaa210cd.zip
store active version id in bots table
Diffstat (limited to 'planetwars-server/src/routes/bots.rs')
-rw-r--r--planetwars-server/src/routes/bots.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/planetwars-server/src/routes/bots.rs b/planetwars-server/src/routes/bots.rs
index 9ddb109..fc180d8 100644
--- a/planetwars-server/src/routes/bots.rs
+++ b/planetwars-server/src/routes/bots.rs
@@ -167,8 +167,9 @@ pub async fn get_my_bots(
.map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)
}
+/// List all active bots
pub async fn list_bots(conn: DatabaseConnection) -> Result<Json<Vec<Bot>>, StatusCode> {
- bots::find_all_bots(&conn)
+ bots::find_active_bots(&conn)
.map(Json)
.map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)
}