From d7b7585dd70f9d41184cf88c2ecbd88341898c38 Mon Sep 17 00:00:00 2001 From: Ilion Beyst Date: Wed, 6 Jul 2022 22:41:27 +0200 Subject: rename code_bundle to bot_version --- planetwars-server/src/routes/bots.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'planetwars-server/src/routes/bots.rs') 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, ) -> Result, 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, mut multipart: Multipart, -) -> Result, StatusCode> { +) -> Result, StatusCode> { let bots_dir = PathBuf::from(BOTS_DIR); let bot = bots::find_bot(bot_id, &conn).map_err(|_| StatusCode::NOT_FOUND)?; -- cgit v1.2.3