fix: schema default value
This commit is contained in:
@@ -28,7 +28,6 @@ impl<'a> RolesRepository<'a> {
|
|||||||
&ResourceEnum::Roles.to_string(),
|
&ResourceEnum::Roles.to_string(),
|
||||||
&meta,
|
&meta,
|
||||||
)
|
)
|
||||||
.with_condition("is_deleted = false")
|
|
||||||
.search_field("name")
|
.search_field("name")
|
||||||
.build()
|
.build()
|
||||||
.await?;
|
.await?;
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ impl RolesSchema {
|
|||||||
.permissions
|
.permissions
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|perm| {
|
.map(|perm| {
|
||||||
make_thing(&ResourceEnum::Permissions.to_string(), &perm.id.to_raw())
|
make_thing(&ResourceEnum::Permissions.to_string(), &perm.id.id.to_raw())
|
||||||
})
|
})
|
||||||
.collect(),
|
.collect(),
|
||||||
is_deleted: dto.is_deleted,
|
is_deleted: dto.is_deleted,
|
||||||
|
|||||||
@@ -24,19 +24,25 @@ pub struct UsersSchema {
|
|||||||
impl Default for UsersSchema {
|
impl Default for UsersSchema {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
Self {
|
Self {
|
||||||
id: Thing::from(("app_users", "dummy")),
|
id: make_thing(
|
||||||
fullname: "".into(),
|
&ResourceEnum::Users.to_string(),
|
||||||
email: "".into(),
|
&Uuid::new_v4().to_string(),
|
||||||
password: "".into(),
|
),
|
||||||
|
fullname: String::new(),
|
||||||
|
email: String::new(),
|
||||||
|
password: hash_password("").unwrap(),
|
||||||
avatar: None,
|
avatar: None,
|
||||||
phone_number: "".into(),
|
phone_number: String::new(),
|
||||||
is_active: false,
|
is_active: false,
|
||||||
is_deleted: false,
|
is_deleted: false,
|
||||||
gender: None,
|
gender: None,
|
||||||
birthdate: None,
|
birthdate: None,
|
||||||
role: Thing::from(("app_roles", "dummy")),
|
role: make_thing(
|
||||||
created_at: "".into(),
|
&ResourceEnum::Roles.to_string(),
|
||||||
updated_at: "".into(),
|
"5713cb37-dc02-4e87-8048-d7a41d352059",
|
||||||
|
),
|
||||||
|
created_at: get_iso_date(),
|
||||||
|
updated_at: get_iso_date(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user