From 759254d95482fa29515a7d17e62470654c852348 Mon Sep 17 00:00:00 2001 From: Oleg Hasjanov Date: Tue, 4 May 2021 14:37:50 +0300 Subject: [PATCH] change response message --- .../repp/v1/registrar/notifications_controller.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controllers/repp/v1/registrar/notifications_controller.rb b/app/controllers/repp/v1/registrar/notifications_controller.rb index 23be6d7b79..b2406a52d2 100644 --- a/app/controllers/repp/v1/registrar/notifications_controller.rb +++ b/app/controllers/repp/v1/registrar/notifications_controller.rb @@ -22,6 +22,7 @@ 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 @@ -29,7 +30,10 @@ def all_notifications 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'