Skip to content

Commit

Permalink
change response message
Browse files Browse the repository at this point in the history
  • Loading branch information
OlegPhenomenon committed May 4, 2021
1 parent d5af1a7 commit 759254d
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,18 @@ def index
desc 'Get the all unread poll messages'
def all_notifications
records = current_user.unread_notifications.order('created_at DESC').all

@notification = records.limit(limit).offset(offset)
# rubocop:disable Style/AndOr
render_success(data: nil) and return unless @notification
# rubocop:enable Style/AndOr

data = @notification.as_json(only: %i[id text attached_obj_id attached_obj_type])

render_success(data: data)
default_count = 200

message = "Command completed successfully. The total notifications are #{records.count}. Returns only #{@notification.count}. Limit by default is #{limit}. To change the amount of data returned, use the parameters limit and offset in url."
render_success(data: data, message: message)
end

api :GET, '/repp/v1/registrar/notifications/:notification_id'
Expand Down

0 comments on commit 759254d

Please sign in to comment.