fix: register roles missmatch

This commit is contained in:
Maulana Sodiqin
2025-05-22 15:13:58 +07:00
parent a4b5d91906
commit 48db5f07ef
3 changed files with 3 additions and 14 deletions
+2 -2
View File
@@ -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,
+1 -1
View File
@@ -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()),
}
}