Skip to content

Commit

Permalink
update create player account endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Created-for-a-purpose committed May 25, 2024
1 parent e3b8f26 commit dcfea1e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 3 additions & 3 deletions node/src/api/accounts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ use aze_types::accounts::{
AccountCreationError,
AccountCreationRequest,
AccountCreationResponse,
PlayerAccountCreationRequest,
PlayerAccountCreationResponse,
};
use aze_lib::utils::log_account_status;
Expand Down Expand Up @@ -123,8 +124,8 @@ pub async fn create_aze_game_account(request_object: Json<AccountCreationRequest
Ok(Json(AccountCreationResponse { game_id: game_account_id.into() }))
}

#[get("/v1/player/create-account")]
pub async fn create_aze_player_account() -> Result<
#[post("/v1/player/create-account")]
pub async fn create_aze_player_account(request_object: Json<PlayerAccountCreationRequest>) -> Result<
Json<PlayerAccountCreationResponse>,
AccountCreationError
> {
Expand All @@ -148,7 +149,6 @@ pub async fn create_aze_player_account() -> Result<

Ok(
Json(PlayerAccountCreationResponse {
is_created: true,
account_id: game_account.id().into(),
})
)
Expand Down
6 changes: 5 additions & 1 deletion types/src/accounts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,13 @@ pub struct AccountCreationResponse {
pub game_id: u64,
}

#[derive(Deserialize, Serialize)]
pub struct PlayerAccountCreationRequest {
pub username: String,
}

#[derive(Deserialize, Serialize)]
pub struct PlayerAccountCreationResponse {
pub is_created: bool,
pub account_id: u64,
}

Expand Down

0 comments on commit dcfea1e

Please sign in to comment.