chore(users): change entity_type column of roles to non-optional (#6435)

This commit is contained in:
Riddhiagrawal001
2024-10-30 18:02:15 +05:30
committed by GitHub
parent bb246e27b7
commit 62067e406a
8 changed files with 17 additions and 7 deletions

View File

@ -92,7 +92,7 @@ pub async fn create_role(
org_id: user_from_token.org_id,
groups: req.groups,
scope: req.role_scope,
entity_type: Some(EntityType::Merchant),
entity_type: EntityType::Merchant,
created_by: user_from_token.user_id.clone(),
last_modified_by: user_from_token.user_id,
created_at: now,

View File

@ -354,7 +354,7 @@ impl RoleInterface for MockDb {
None => true,
};
matches_merchant && role.org_id == *org_id && role.entity_type == entity_type
matches_merchant && role.org_id == *org_id && Some(role.entity_type) == entity_type
})
.take(limit_usize)
.cloned()

View File

@ -119,7 +119,7 @@ impl From<diesel_models::role::Role> for RoleInfo {
role_name: role.role_name,
groups: role.groups.into_iter().map(Into::into).collect(),
scope: role.scope,
entity_type: role.entity_type.unwrap_or(EntityType::Merchant),
entity_type: role.entity_type,
is_invitable: true,
is_deletable: true,
is_updatable: true,