ishapi 0.1.8.176 → 0.1.8.177
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/controllers/ishapi/user_profiles_controller.rb +16 -2
- data/app/models/ishapi/ability.rb +3 -0
- data/config/routes.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3d2316758e2797aeecb65f3e8cacdb034902a7271f8518da15707050bf64e097
|
4
|
+
data.tar.gz: ba8bc72419963ea42441cee3dfd3b537aa79d3bf8dd21ff5fa4f44f7e77b37c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 33e25407dddeeafa0fe7e80e3483c0e674ebb36028644f69c4b37c2ac03787d93568cddad0ce6981d4c63c0f527c754a4bb572e6d4a8d622e215d212c9e9b22b
|
7
|
+
data.tar.gz: cfed72d717b27f1c7f303eace2491441f0e5108f2536a51fdedaf7c1ed00735012a16b2db13422e4dc6f93aff33a008e4a5b843685fd26fc4c443f3f22fcea60
|
@@ -2,12 +2,26 @@ require_dependency "ishapi/application_controller"
|
|
2
2
|
module Ishapi
|
3
3
|
class UserProfilesController < ApplicationController
|
4
4
|
|
5
|
-
before_action :check_profile
|
5
|
+
before_action :check_profile, only: %i| show | ## @TODO: hmmm I may not need this check at all
|
6
|
+
|
7
|
+
before_action :check_profile_hard, only: %i| update |
|
6
8
|
|
7
9
|
def show
|
8
|
-
@profile =
|
10
|
+
@profile = Ish::UserProfile.find_by :username => params[:username]
|
9
11
|
authorize! :show, @profile
|
10
12
|
end
|
11
13
|
|
14
|
+
def update
|
15
|
+
@profile = Ish::UserProfile.find @current_user.profile
|
16
|
+
authorize! :update, @profile
|
17
|
+
|
18
|
+
flag = @profile.update params[:profile].permit!
|
19
|
+
if flag
|
20
|
+
render json: { message: 'ok' }, status: :ok
|
21
|
+
else
|
22
|
+
render json: { message: "No luck: #{@profile.errors.full_messages.join(", ")}." }, code: 400
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
12
26
|
end
|
13
27
|
end
|
data/config/routes.rb
CHANGED
@@ -58,8 +58,8 @@ Ishapi::Engine.routes.draw do
|
|
58
58
|
|
59
59
|
post 'users/fb_sign_in', to: 'users#fb_sign_in'
|
60
60
|
get 'users/me', to: 'users#account'
|
61
|
-
post 'users/profile', to: 'users#show'
|
62
|
-
post 'users/profile/update', to: '
|
61
|
+
post 'users/profile', to: 'users#show' ## @TODO: change, this makes no sense
|
62
|
+
post 'users/profile/update', to: 'user_profiles#update'
|
63
63
|
get 'users/profile', to: 'users#show' # @TODO: only for testing! accessToken must be hidden
|
64
64
|
match 'users/long_term_token', to: 'application#long_term_token', via: [ :get, :post ]
|
65
65
|
post 'users/login', to: 'users#login'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ishapi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.8.
|
4
|
+
version: 0.1.8.177
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- piousbox
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-04-
|
11
|
+
date: 2022-04-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|