add typ
This commit is contained in:
22
src/domain/typ/service/typ_loeschen.rs
Normal file
22
src/domain/typ/service/typ_loeschen.rs
Normal file
@@ -0,0 +1,22 @@
|
||||
use anyhow::Error;
|
||||
use chrono::Utc;
|
||||
|
||||
use super::Service;
|
||||
use crate::domain::typ::{
|
||||
entity,
|
||||
model::{self, TypLoeschenInput},
|
||||
};
|
||||
|
||||
impl Service {
|
||||
pub async fn typ_loeschen(&self, input: TypLoeschenInput) -> Result<model::Typ, Error> {
|
||||
let typ_input = entity::Typ {
|
||||
id: input.id,
|
||||
typname: String::new(),
|
||||
erstellt_am: None,
|
||||
geaendert_am: Some(Utc::now()),
|
||||
};
|
||||
|
||||
let typ = self.repo.typ_loeschen(&self.db, &typ_input).await?;
|
||||
Ok(typ)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user