From 1906d66026cf6b7c422a161491a89ebfb374fd3b Mon Sep 17 00:00:00 2001 From: antifallobst Date: Sun, 31 Mar 2024 17:06:21 +0200 Subject: [PATCH] fix(client >> session >> data): made a deserializable enum for permissions instead of using strings --- client/src/session/data.rs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/client/src/session/data.rs b/client/src/session/data.rs index 5bb4ada..aaf45e2 100644 --- a/client/src/session/data.rs +++ b/client/src/session/data.rs @@ -1,25 +1,30 @@ use serde::Deserialize; +#[derive(Debug, Deserialize)] +pub enum Permission { + GenerateInviteTokens, + PromoteUsers, +} + pub mod api { - use super::Deserialize; + use super::*; pub mod account { - use super::Deserialize; + use super::*; pub mod info { - use super::Deserialize; + use super::*; #[derive(Debug, Deserialize)] pub struct Response { pub userid: String, - // TODO: make permissions an enum - pub permissions: Vec, + pub permissions: Vec, } } } pub mod error { - use super::Deserialize; + use super::*; #[derive(Debug, thiserror::Error, Deserialize)] pub enum Error {