fix: register roles missmatch
This commit is contained in:
@@ -125,9 +125,9 @@ impl<'a> UsersRepository<'a> {
|
||||
bail!("User already deleted");
|
||||
}
|
||||
let role_thing = if data.role == existing.role.id {
|
||||
existing.role.id
|
||||
existing.role.id.clone()
|
||||
} else {
|
||||
data.clone().role
|
||||
data.role.clone()
|
||||
};
|
||||
let merged = UsersSchema {
|
||||
password: existing.password,
|
||||
|
||||
@@ -56,7 +56,7 @@ impl UsersSchema {
|
||||
password: dto.password,
|
||||
created_at: dto.created_at,
|
||||
updated_at: dto.updated_at,
|
||||
role: make_thing(&ResourceEnum::Roles.to_string(), &dto.role.id.to_string()),
|
||||
role: make_thing(&ResourceEnum::Roles.to_string(), &dto.role.id.id.to_raw()),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user