collingreen / startuppong

Simple ping pong ladder
startuppong.com
MIT License
2 stars 3 forks source link

Return a match from the `add_match` endpoint #22

Open jwilm opened 9 years ago

jwilm commented 9 years ago

After adding a match it's nice to get all of the match data immediately (new/old ranks, etc). That currently requires a second request. Please just return that same data as the result to add_match on success.

This is the object which I'm referencing as a match.

    {
      id: [match_id],
      played_time: [match_played_time],
      winner_id: [winning_player_id],
      winner_name: [winner_player_name],
      winner_rank_before: [winner_rank_before_match],
      winner_rank_after: [winner_rank_after_match],
      winner_rating_before: [winner_rating_before_match],
      winner_rating_after: [winner_rating_after_match],
      loser_id: [losing_player_id],
      loser_name: [losing_player_name],
      loser_rank_before: [loser_rank_before_match],
      loser_rank_after: [loser_rank_after_match],
      loser_rating_before: [loser_rating_before_match],
      loser_rating_after: [loser_rating_after_match]
    }
collingreen commented 9 years ago

Also could include the people passed (if ranks are on)