Sha256: 5b6a4bf941fdfaedc6f18559266efdcb5c8e13c1975fa8823b0fb387d72466e9

Contents?: true

Size: 588 Bytes

Versions: 6

Compression:

Stored size: 588 Bytes

Contents

module API
  module Mounts
    class Profile < Grape::API
      before {
        @user = current_user
        authorize! :update_profile, @user
      }
      params do
        optional :display_name
        <% if @carrierwave %>
        optional :avatar
        optional :remove_avatar
        mutually_exclusive :avatar, :remove_avatar
        <% end %>
      end
      put jbuilder: 'v1/user/profile.json' do
        declared(params, include_missing: false).each {|k,v| @user.send("#{k}=", v) }
        @user.save!
      end

      get jbuilder: 'v1/user/profile.json'
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
grape-gen-0.0.6 template/api/mounts/profile.rb.tt
grape-gen-0.0.5 template/api/mounts/profile.rb.tt
grape-gen-0.0.4 template/api/mounts/profile.rb.tt
grape-gen-0.0.3 template/api/mounts/profile.rb.tt
grape-gen-0.0.2 template/api/mounts/profile.rb.tt
grape-gen-0.0.1 template/api/mounts/profile.rb.tt