@@ -70,7 +70,7 @@ class Topics < Grape::API
7070 topic = Topic . includes ( :posts ) . find ( permitted_params [ :id ] )
7171 end
7272 if topic . present?
73- present topic , with : Entity ::Topic , posts : true
73+ present topic , with : Entity ::Topic , posts : true , user : true
7474 else
7575 error! ( 'Unauthorized. Insufficient access priviledges.' , 401 )
7676 end
@@ -124,7 +124,7 @@ class Topics < Grape::API
124124 user_id : user_id ,
125125 kind : 'first' ,
126126 )
127- present ticket , with : Entity ::Topic , posts : true
127+ present ticket , with : Entity ::Topic , posts : true , user : true
128128 end
129129
130130 # ASSIGN TICKET
@@ -144,7 +144,7 @@ class Topics < Grape::API
144144 previous_assigned_id = ticket . assigned_user_id? ? ticket . assigned_user_id : params [ :assigned_user_id ]
145145 assigned_user = User . find ( params [ :assigned_user_id ] )
146146 ticket . assign ( previous_assigned_id , assigned_user . id )
147- present ticket , with : Entity ::Topic , posts : true
147+ present ticket , with : Entity ::Topic , posts : true , user : true
148148 else
149149 error! ( 'Unauthorized. Insufficient access priviledges.' , 401 )
150150 end
@@ -175,7 +175,7 @@ class Topics < Grape::API
175175 ticket . current_status = params [ :status ]
176176 ticket . save
177177 end
178- present ticket , with : Entity ::Topic , posts : true
178+ present ticket , with : Entity ::Topic , posts : true , user : true
179179 else
180180 error! ( 'Unauthorized. Insufficient access priviledges.' , 401 )
181181 end
@@ -197,7 +197,7 @@ class Topics < Grape::API
197197 if ticket . present?
198198 ticket . tag_list = params [ :tag_list ]
199199 ticket . save
200- present ticket , with : Entity ::Topic , posts : true
200+ present ticket , with : Entity ::Topic , posts : true , user : true
201201 else
202202 error! ( 'Unauthorized. Insufficient access priviledges.' , 401 )
203203 end
@@ -221,7 +221,7 @@ class Topics < Grape::API
221221 ticket . private = is_private
222222 ticket . forum_id = params [ :forum_id ]
223223 ticket . save
224- present ticket , with : Entity ::Topic , posts : true
224+ present ticket , with : Entity ::Topic , posts : true , user : true
225225 else
226226 error! ( 'Unauthorized. Insufficient access priviledges.' , 401 )
227227 end
@@ -280,7 +280,7 @@ class Topics < Grape::API
280280 post "merge" , root : :topics do
281281 @ticket = Topic . merge_topics ( params [ :topic_ids ] , params [ :user_id ] )
282282 if @ticket . present?
283- present @ticket , with : Entity ::Topic , posts : true
283+ present @ticket , with : Entity ::Topic , posts : true , user : true
284284 end
285285 end
286286 end
@@ -298,7 +298,7 @@ class Topics < Grape::API
298298 end
299299 get ":id" , root : :topics do
300300 topic = Topic . includes ( :posts ) . find ( permitted_params [ :id ] ) #
301- present topic , with : Entity ::Topic , posts : true
301+ present topic , with : Entity ::Topic , posts : true , user : true
302302 end
303303
304304
@@ -329,7 +329,7 @@ class Topics < Grape::API
329329 user_id : permitted_params [ :user_id ] ,
330330 kind : 'first'
331331 )
332- present topic , with : Entity ::Topic , posts : true
332+ present topic , with : Entity ::Topic , posts : true , user : true
333333 end
334334
335335 # UPDATE SINGLE TOPIC (PRIVACY, STATUS, ASSIGNED, ETC)
@@ -352,7 +352,7 @@ class Topics < Grape::API
352352 assigned_user_id : permitted_params [ :assigned_user_id ] ,
353353 priority : permitted_params [ :priority ] || 'normal'
354354 )
355- present topic , with : Entity ::Topic , posts : true
355+ present topic , with : Entity ::Topic , posts : true , user : true
356356 end
357357
358358 # VOTE FOR A TOPIC
0 commit comments