diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2018-12-31 18:05:24 -0800 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2018-12-31 18:05:26 -0800 |
commit | 42ffee8c583729287aed7eaa6df4b7b121c1f7f6 (patch) | |
tree | 40afc986b07d6af1f04913b43c20e81dfe38d22a /rust/src/api_server.rs | |
parent | 48379975135f470f7e2faac6423c6188e3798b2d (diff) | |
download | fatcat-42ffee8c583729287aed7eaa6df4b7b121c1f7f6.tar.gz fatcat-42ffee8c583729287aed7eaa6df4b7b121c1f7f6.zip |
make editor_id optional when createding editgroup
The editor_id can be infered from auth metadata.
Diffstat (limited to 'rust/src/api_server.rs')
-rw-r--r-- | rust/src/api_server.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/rust/src/api_server.rs b/rust/src/api_server.rs index 853f7bc2..be9f1883 100644 --- a/rust/src/api_server.rs +++ b/rust/src/api_server.rs @@ -384,7 +384,7 @@ impl Server { ) -> Result<Editgroup> { let row: EditgroupRow = insert_into(editgroup::table) .values(( - editgroup::editor_id.eq(FatCatId::from_str(&entity.editor_id)?.to_uuid()), + editgroup::editor_id.eq(FatCatId::from_str(&entity.editor_id.unwrap())?.to_uuid()), editgroup::description.eq(entity.description), editgroup::extra_json.eq(entity.extra), )) @@ -392,7 +392,7 @@ impl Server { Ok(Editgroup { editgroup_id: Some(uuid2fcid(&row.id)), - editor_id: uuid2fcid(&row.editor_id), + editor_id: Some(uuid2fcid(&row.editor_id)), description: row.description, edits: None, extra: row.extra_json, @@ -467,7 +467,7 @@ impl Server { let eg = Editgroup { editgroup_id: Some(uuid2fcid(&row.id)), - editor_id: uuid2fcid(&row.editor_id), + editor_id: Some(uuid2fcid(&row.editor_id)), description: row.description, edits: Some(edits), extra: row.extra_json, |