23 lines
526 B
Rust
23 lines
526 B
Rust
|
|
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)
|
||
|
|
}
|
||
|
|
}
|