bleghh
This commit is contained in:
parent
1988abe369
commit
54ce9f63f5
3 changed files with 5 additions and 1 deletions
2
migrations/8_private_tags.sql
Normal file
2
migrations/8_private_tags.sql
Normal file
|
@ -0,0 +1,2 @@
|
|||
alter table doll_profiles
|
||||
add column is_public boolean not null default true;
|
|
@ -31,6 +31,7 @@ pub async fn list_all(db: &mut DbHook, from: &Uuid) -> sqlx::Result<Vec<DollProf
|
|||
.fetch_all(&mut **db)
|
||||
.await
|
||||
}
|
||||
// TODO: its a fkin mess and i dont wanna deal with multiple state variables right now. probably need a struct instead of bools in the rust side
|
||||
|
||||
pub async fn get(
|
||||
db: &mut DbHook,
|
||||
|
@ -53,7 +54,7 @@ pub async fn get(
|
|||
sqlx::query_as!(
|
||||
DollProfile,
|
||||
r#"
|
||||
select * from doll_profiles where (id = $1 or microchip_id = $2) and archived_at is null
|
||||
select * from doll_profiles where (id = $1 or microchip_id = $2) and archived_at is null and is_public is true
|
||||
"#,
|
||||
ident,
|
||||
microchip_id
|
||||
|
|
|
@ -23,6 +23,7 @@ pub struct DollProfile {
|
|||
pub created_at: chrono::DateTime<Utc>,
|
||||
pub updated_at: Option<chrono::DateTime<Utc>>,
|
||||
pub archived_at: Option<chrono::DateTime<Utc>>,
|
||||
pub is_public: bool,
|
||||
|
||||
pub bound_to_id: Uuid,
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue