Cleanup db/tag namespace
This commit is contained in:
parent
effd3f3b18
commit
80d1fa32a0
4 changed files with 71 additions and 69 deletions
src/db
|
@ -7,8 +7,7 @@ use sqlx::Sqlite;
|
|||
|
||||
use crate::db::errors::DatabaseError;
|
||||
use crate::db::model_utils::Period;
|
||||
use crate::db::models::*;
|
||||
use crate::db::tag::{create_junction_tag_schedule, create_tag};
|
||||
use crate::db::tag::Tag;
|
||||
use crate::types::EmgauwaUid;
|
||||
|
||||
#[derive(Debug, Serialize, Clone)]
|
||||
|
@ -143,10 +142,10 @@ impl Schedule {
|
|||
|
||||
let tag = match tag {
|
||||
Some(id) => id,
|
||||
None => create_tag(conn, new_tag).await?,
|
||||
None => Tag::create(conn, new_tag).await?,
|
||||
};
|
||||
|
||||
create_junction_tag_schedule(conn, tag, self).await?;
|
||||
tag.link_schedule(conn, self).await?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue