fix entry PUTting

feat/vaults
Tomáš Mládek 2022-02-12 13:56:41 +01:00
parent 66253fb3e5
commit 471c60c19e
No known key found for this signature in database
GPG Key ID: 65E225C8B3E2ED8A
2 changed files with 9 additions and 0 deletions

View File

@ -9,6 +9,7 @@ use std::io::{Cursor, Write};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum InEntry {
Entry(Entry),
Invariant(InvariantEntry),
Address { entity: InAddress },
}

View File

@ -258,6 +258,14 @@ pub async fn put_object(
debug!("PUTting {in_entry:?}");
match in_entry {
InEntry::Entry(entry) => Ok((
Some(
connection
.insert_entry(entry.clone())
.map_err(ErrorInternalServerError)?,
),
entry.entity,
)),
InEntry::Invariant(in_entry) => {
let invariant = Entry::try_from(&InvariantEntry {
attribute: in_entry.attribute,