aboutsummaryrefslogtreecommitdiff
path: root/planetwars-server/src/routes/bots.rs
diff options
context:
space:
mode:
authorIlion Beyst <ilion.beyst@gmail.com>2022-07-06 22:41:27 +0200
committerIlion Beyst <ilion.beyst@gmail.com>2022-07-06 22:41:27 +0200
commitd7b7585dd70f9d41184cf88c2ecbd88341898c38 (patch)
tree89a7fc180152f18273159104265e7894718e8560 /planetwars-server/src/routes/bots.rs
parentb3df5c6f8cc59e099a2f1db3df8089af4abca02e (diff)
downloadplanetwars.dev-d7b7585dd70f9d41184cf88c2ecbd88341898c38.tar.xz
planetwars.dev-d7b7585dd70f9d41184cf88c2ecbd88341898c38.zip
rename code_bundle to bot_version
Diffstat (limited to 'planetwars-server/src/routes/bots.rs')
-rw-r--r--planetwars-server/src/routes/bots.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/planetwars-server/src/routes/bots.rs b/planetwars-server/src/routes/bots.rs
index 6d5d7df..1ffedef 100644
--- a/planetwars-server/src/routes/bots.rs
+++ b/planetwars-server/src/routes/bots.rs
@@ -11,7 +11,7 @@ use std::io::Cursor;
use std::path::PathBuf;
use thiserror;
-use crate::db::bots::{self, CodeBundle};
+use crate::db::bots::{self, BotVersion};
use crate::db::ratings::{self, RankedBot};
use crate::db::users::User;
use crate::modules::bots::save_code_bundle;
@@ -148,8 +148,8 @@ pub async fn get_bot(
Path(bot_id): Path<i32>,
) -> Result<Json<JsonValue>, StatusCode> {
let bot = bots::find_bot(bot_id, &conn).map_err(|_| StatusCode::NOT_FOUND)?;
- let bundles = bots::find_bot_code_bundles(bot.id, &conn)
- .map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)?;
+ let bundles =
+ bots::find_bot_versions(bot.id, &conn).map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)?;
Ok(Json(json!({
"bot": bot,
"bundles": bundles,
@@ -183,7 +183,7 @@ pub async fn upload_code_multipart(
user: User,
Path(bot_id): Path<i32>,
mut multipart: Multipart,
-) -> Result<Json<CodeBundle>, StatusCode> {
+) -> Result<Json<BotVersion>, StatusCode> {
let bots_dir = PathBuf::from(BOTS_DIR);
let bot = bots::find_bot(bot_id, &conn).map_err(|_| StatusCode::NOT_FOUND)?;