Small rewrite to allow fetching owned game of users
This commit is contained in:
@@ -505,7 +505,9 @@ pub async fn own_post(configuration: &configuration::Configuration, game_id: Opt
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn owned_games_get(configuration: &configuration::Configuration, ) -> Result<Vec<String>, Error<OwnedGamesGetError>> {
|
||||
pub async fn owned_games_get(configuration: &configuration::Configuration, user_id: Option<models::UserId>) -> Result<Vec<String>, Error<OwnedGamesGetError>> {
|
||||
// add a prefix to parameters to efficiently prevent name collisions
|
||||
let p_user_id = user_id;
|
||||
|
||||
let uri_str = format!("{}/owned_games", configuration.base_path);
|
||||
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
|
||||
@@ -516,6 +518,7 @@ pub async fn owned_games_get(configuration: &configuration::Configuration, ) ->
|
||||
if let Some(ref token) = configuration.bearer_access_token {
|
||||
req_builder = req_builder.bearer_auth(token.to_owned());
|
||||
};
|
||||
req_builder = req_builder.json(&p_user_id);
|
||||
|
||||
let req = req_builder.build()?;
|
||||
let resp = configuration.client.execute(req).await?;
|
||||
|
||||
Reference in New Issue
Block a user