diff --git a/web/app/controllers/api_users_controller.rb b/web/app/controllers/api_users_controller.rb index c4a986ad1..6266e2a25 100644 --- a/web/app/controllers/api_users_controller.rb +++ b/web/app/controllers/api_users_controller.rb @@ -32,17 +32,20 @@ class ApiUsersController < ApiController respond_with @user, responder: ApiResponder, :status => 200 end - def profile + def profile_show @profile = User.includes([{musician_instruments: :instrument}, {band_musicians: :user}, {genre_players: :genre}, :bands, :instruments, :genres, - :user_presences, :performance_samples]) + :online_presences, :performance_samples]) .find(params[:id]) respond_with @profile, responder: ApiResponder, :status => 200 end + def profile_save + end + def update @user = User.find(params[:id]) diff --git a/web/app/views/api_users/profile.rabl b/web/app/views/api_users/profile_show.rabl similarity index 90% rename from web/app/views/api_users/profile.rabl rename to web/app/views/api_users/profile_show.rabl index bdb137c20..820a3809b 100644 --- a/web/app/views/api_users/profile.rabl +++ b/web/app/views/api_users/profile_show.rabl @@ -3,7 +3,7 @@ object @profile attributes :id, :first_name, :last_name, :name, :city, :state, :country, :location, :online, :photo_url, :musician, :gender, :birth_date, :internet_service_provider, :friend_count, :liker_count, :like_count, :follower_count, :following_count, :recording_count, :session_count, :biography, :favorite_count, :audio_latency, :upcoming_session_count, :age, :website, :skill_level, :concert_count, :studio_session_count, :virtual_band, :virtual_band_commitment, :traditional_band, :traditional_band_commitment, :traditional_band_touring, :paid_sessions, :paid_sessions_hourly_rate, :paid_sessions_daily_rate, :free_sessions, :cowriting, :cowriting_purpose -child :user_presences => :online_presences do +child :online_presences => :online_presences do attributes :id, :service_type, :username end @@ -16,5 +16,5 @@ child :performance_samples => :performance_samples do end child :genre_players => :genres do - attributes :genre_id, :player_type + attributes :genre_id, :player_type, :genre_type end \ No newline at end of file diff --git a/web/config/routes.rb b/web/config/routes.rb index 79b53b120..06f96a41f 100644 --- a/web/config/routes.rb +++ b/web/config/routes.rb @@ -341,7 +341,8 @@ SampleApp::Application.routes.draw do match '/users/:id/share/recording/:provider' => 'api_users#share_recording', :via => :get #profile - match '/users/:id/profile' => 'api_users#profile', :via => :get, :as => 'api_users_profile' + match '/users/:id/profile' => 'api_users#profile_show', :via => :get, :as => 'api_users_profile_show' + match '/users/:id/profile' => 'api_users#profile_save', :via => :post # session chat match '/chat' => 'api_chats#create', :via => :post