summaryrefslogtreecommitdiffstats
path: root/rust/src/api_server.rs
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-05-24 17:42:42 -0700
committerBryan Newbold <bnewbold@robocracy.org>2018-05-24 17:42:42 -0700
commit6ece23cce5f90eed034ea34a1c751da64d812a87 (patch)
treec80b34d04381557784ed99d567dd14d11409e7a6 /rust/src/api_server.rs
parent4eb8b801ba937e6f0af25bfc233c13b8e25138c0 (diff)
downloadfatcat-6ece23cce5f90eed034ea34a1c751da64d812a87.tar.gz
fatcat-6ece23cce5f90eed034ea34a1c751da64d812a87.zip
update codegen and hack-fix tests
Diffstat (limited to 'rust/src/api_server.rs')
-rw-r--r--rust/src/api_server.rs19
1 files changed, 9 insertions, 10 deletions
diff --git a/rust/src/api_server.rs b/rust/src/api_server.rs
index c91af9c9..5069d15d 100644
--- a/rust/src/api_server.rs
+++ b/rust/src/api_server.rs
@@ -543,8 +543,9 @@ impl Api for Server {
Some(param) => param as i64,
};
- let edit: FileEditRow = diesel::sql_query(
- "WITH rev AS ( INSERT INTO file_rev (size, sha1, url)
+ let edit: FileEditRow =
+ diesel::sql_query(
+ "WITH rev AS ( INSERT INTO file_rev (size, sha1, url)
VALUES ($1, $2, $3)
RETURNING id ),
ident AS ( INSERT INTO file_ident (rev_id)
@@ -553,14 +554,12 @@ impl Api for Server {
INSERT INTO file_edit (editgroup_id, ident_id, rev_id) VALUES
($4, (SELECT ident.id FROM ident), (SELECT rev.id FROM rev))
RETURNING *",
- ).bind::<diesel::sql_types::Nullable<diesel::sql_types::Int4>, _>(
- body.size.map(|v| v as i32),
- )
- .bind::<diesel::sql_types::Nullable<diesel::sql_types::Text>, _>(body.sha1)
- .bind::<diesel::sql_types::Nullable<diesel::sql_types::Text>, _>(body.url)
- .bind::<diesel::sql_types::BigInt, _>(editgroup_id)
- .get_result(&conn)
- .unwrap();
+ ).bind::<diesel::sql_types::Nullable<diesel::sql_types::Int8>, _>(body.size)
+ .bind::<diesel::sql_types::Nullable<diesel::sql_types::Text>, _>(body.sha1)
+ .bind::<diesel::sql_types::Nullable<diesel::sql_types::Text>, _>(body.url)
+ .bind::<diesel::sql_types::BigInt, _>(editgroup_id)
+ .get_result(&conn)
+ .unwrap();
let edit = &edit;
let entity_edit = EntityEdit {