forked from Roflin/gamenight
Refactored the connect flow and make canceling behavior more consistent.
This commit is contained in:
@@ -245,6 +245,9 @@ components:
|
||||
type: string
|
||||
datetime:
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
- datetime
|
||||
GamenightId:
|
||||
title: GamenightId
|
||||
type: object
|
||||
|
||||
@@ -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
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user