mirror of
https://github.com/ENSL/ensl.org.git
synced 2025-05-30 00:11:31 +00:00
Added steam profile lookup API endpoint
This commit is contained in:
parent
b97b3173bc
commit
4b9f2e6d84
6 changed files with 47 additions and 11 deletions
|
@ -1,5 +1,17 @@
|
|||
class Api::V1::UsersController < Api::V1::BaseController
|
||||
def index
|
||||
respond_with Api::V1::UsersCollection.as_json
|
||||
render json: Api::V1::UsersCollection.as_json
|
||||
end
|
||||
|
||||
def show
|
||||
@user = User.find(params[:id])
|
||||
@steam = SteamCondenser::Community::SteamId.from_steam_id("STEAM_#{@user.steamid}")
|
||||
|
||||
render json: {
|
||||
steam: {
|
||||
url: @steam.base_url,
|
||||
nickname: @steam.nickname
|
||||
}
|
||||
}
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue