@@ -79,6 +79,7 @@ class Users < Grape::API
7979 optional :linkedin , type : String , desc : "Users Linkedin username"
8080 optional :language , type : String , desc : "Users prefered language"
8181 optional :active , type : Boolean , desc : "User active or deactivated" , default : true
82+ optional :priority , type : String , desc : "Users Priority" , values : [ 'low' , 'normal' , 'high' , 'vip' ] , default : 'normal'
8283 end
8384 post "" , root : :users do
8485 user = User . create! (
@@ -103,7 +104,8 @@ class Users < Grape::API
103104 twitter : permitted_params [ :twitter ] ,
104105 linkedin : permitted_params [ :linkedin ] ,
105106 language : permitted_params [ :language ] ,
106- active : permitted_params [ :active ]
107+ active : permitted_params [ :active ] ,
108+ priority : permitted_params [ :priority ]
107109 )
108110 present user , with : Entity ::User
109111 end
@@ -137,6 +139,7 @@ class Users < Grape::API
137139 optional :linkedin , type : String , desc : "Users Linkedin username"
138140 optional :language , type : String , desc : "Users prefered language"
139141 optional :active , type : Boolean , desc : "User active or deactivated"
142+ optional :priority , type : String , desc : "Users Priority- low, normal, high or vip" , default : 'normal'
140143 end
141144 patch ":id" , root : :users do
142145 user = User . where ( id : permitted_params [ :id ] ) . first
@@ -162,7 +165,8 @@ class Users < Grape::API
162165 twitter : permitted_params [ :twitter ] ,
163166 linkedin : permitted_params [ :linkedin ] ,
164167 language : permitted_params [ :language ] ,
165- active : permitted_params [ :active ]
168+ active : permitted_params [ :active ] ,
169+ priority : permitted_params [ :priority ]
166170 )
167171 present user , with : Entity ::User
168172 end
0 commit comments