aboutsummaryrefslogtreecommitdiff
path: root/planetwars-server/src/db/bots.rs
diff options
context:
space:
mode:
authorIlion Beyst <ilion.beyst@gmail.com>2021-12-31 11:24:25 +0100
committerIlion Beyst <ilion.beyst@gmail.com>2021-12-31 11:24:25 +0100
commit3e902bb56e9626c8296e9836aa9ae19d82d48394 (patch)
tree3b6b11fdf68c8d41f2b2bceebe1c2469ebc00cb6 /planetwars-server/src/db/bots.rs
parent0f27ca80fbdb3366e047def628123d3cc8ca051c (diff)
downloadplanetwars.dev-3e902bb56e9626c8296e9836aa9ae19d82d48394.tar.xz
planetwars.dev-3e902bb56e9626c8296e9836aa9ae19d82d48394.zip
list uploaded code bundles on bot page
Diffstat (limited to 'planetwars-server/src/db/bots.rs')
-rw-r--r--planetwars-server/src/db/bots.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/planetwars-server/src/db/bots.rs b/planetwars-server/src/db/bots.rs
index d21d9dc..eb66c05 100644
--- a/planetwars-server/src/db/bots.rs
+++ b/planetwars-server/src/db/bots.rs
@@ -57,3 +57,9 @@ pub fn create_code_bundle(
.values(new_code_bundle)
.get_result(conn)
}
+
+pub fn find_bot_code_bundles(bot_id: i32, conn: &PgConnection) -> QueryResult<Vec<CodeBundle>> {
+ code_bundles::table
+ .filter(code_bundles::bot_id.eq(bot_id))
+ .get_results(conn)
+}