Refactored the connect flow and make canceling behavior more consistent.

This commit is contained in:
2025-06-27 16:09:30 +02:00
parent f0883a0ff0
commit 3f51d52edf
8 changed files with 121 additions and 79 deletions

View File

@@ -11,9 +11,9 @@ use crate::request::error::ApiError;
impl AddGamenightRequestBody {
pub fn into_with_user(&self, user: AuthUser) -> Result<gamenight::Gamenight, ParseError> {
Ok(gamenight::Gamenight {
datetime: DateTime::parse_from_rfc3339(&self.clone().datetime.unwrap())?.with_timezone(&chrono::Utc),
datetime: DateTime::parse_from_rfc3339(&self.datetime)?.with_timezone(&chrono::Utc),
id: Uuid::new_v4(),
name: self.clone().name.unwrap().clone(),
name: self.name.clone(),
owner_id: user.0.id
})
}