-
-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(model, http)!: fix role position update payload and allow audit log reason #2342
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Thinking out loud) We could keep the &[(Id, u64)]
parameter as is, with a little magic, via a custom serializer (on a private newtype) like:
- roles: &'a [(Id<RoleMarker>, u64)],
+ roles: Roles<'a>,
struct Roles<'a>(&'a [(Id<RoleMarker>, u64)]);
impl Serialize for Roles<'_> {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: Serializer,
{
serializer.collect_seq(self.0.map(/* tuple to RolePosition */))
}
}
I think I would like the struct way more than the tuple. |
Co-authored-by: Tim Vilgot Mikael Fredenberg <26655508+vilgotf@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a huge fan of the "RolePosition" name since it contains more then just the position. Maybe "RoleMeta" or so might be better but that might then also implies it has more? not entirely sure if there is a better name
Closes #2338 and adds audit log reason support for this endpoint.