diff --git a/CHANGELOG.md b/CHANGELOG.md index 1739161..12aa32f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,6 +46,13 @@ Versioning](https://semver.org/spec/v2.0.0.html). type instead of `usize` type value for the `cluster_id` field. - Updated `insertNode` GraphQL API to no longer require `config` for the `agents` parameter. +- Updated account-related GraphQL APIs to reflect the type change of + `Account::max_parallel_sessions` from `Option` to `Option`. + - The `account` and related queries such as `accountList` now return + `maxParallelSessions` as an `Int` within the range of `u8`. + - The `insertAccount` and `updateAccount` GraphQL APIs remain unchanged in + their interfaces but now only accept parameters related to max parallel + sessions within the range of `u8`. ### Removed diff --git a/Cargo.toml b/Cargo.toml index 12495c6..d3d6289 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,7 +25,7 @@ num-traits = "0.2" reqwest = { version = "0.12", default-features = false, features = [ "rustls-tls-native-roots", ] } -review-database = { git = "https://github.com/petabi/review-database.git", rev = "f59bef0" } +review-database = { git = "https://github.com/petabi/review-database.git", rev = "3be5e9f" } roxy = { git = "https://github.com/aicers/roxy.git", tag = "0.3.0" } rustls = { version = "0.23", default-features = false, features = [ "ring", diff --git a/src/graphql/account.rs b/src/graphql/account.rs index a99a495..15b416a 100644 --- a/src/graphql/account.rs +++ b/src/graphql/account.rs @@ -7,7 +7,7 @@ use anyhow::anyhow; use async_graphql::connection::OpaqueCursor; use async_graphql::{ connection::{Connection, EmptyFields}, - Context, Enum, InputObject, Object, Result, SimpleObject, StringNumber, + Context, Enum, InputObject, Object, Result, SimpleObject, }; use chrono::{DateTime, NaiveDateTime, TimeZone, Utc}; use review_database::{ @@ -173,7 +173,7 @@ impl AccountMutation { language: Option, theme: Option, allow_access_from: Option>, - max_parallel_sessions: Option, + max_parallel_sessions: Option, ) -> Result { let store = crate::graphql::get_store(ctx).await?; let table = store.account_map(); @@ -673,10 +673,10 @@ impl Account { .map(|ips| ips.iter().map(ToString::to_string).collect::>()) } - /// The max sessions that can be run in parallel in string within the - /// representable range of `u32`. - async fn max_parallel_sessions(&self) -> Option> { - self.inner.max_parallel_sessions.map(StringNumber) + /// The max sessions that can be run in parallel within the + /// representable range of `u8`. + async fn max_parallel_sessions(&self) -> Option { + self.inner.max_parallel_sessions } } @@ -751,11 +751,12 @@ struct UpdateAllowAccessFrom { new: Option>, } -/// The old and new values of `maxParallelSessions` to update. +/// The old and new values of `maxParallelSessions` to update, +/// and the values must be in the range of `u8`. #[derive(InputObject)] struct UpdateMaxParallelSessions { - old: Option, - new: Option, + old: Option, + new: Option, } struct AccountTotalCount;