forked from Roflin/gamenight
Converted the Api to a Restful api.
This commit is contained in:
@@ -13,6 +13,8 @@ use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct OwnedGame {
|
||||
#[serde(rename = "user_id")]
|
||||
pub user_id: String,
|
||||
#[serde(rename = "game_id")]
|
||||
pub game_id: String,
|
||||
#[serde(rename = "location_id", skip_serializing_if = "Option::is_none")]
|
||||
@@ -20,8 +22,9 @@ pub struct OwnedGame {
|
||||
}
|
||||
|
||||
impl OwnedGame {
|
||||
pub fn new(game_id: String) -> OwnedGame {
|
||||
pub fn new(user_id: String, game_id: String) -> OwnedGame {
|
||||
OwnedGame {
|
||||
user_id,
|
||||
game_id,
|
||||
location_id: None,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user