about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2020-06-03 20:32:15 +0200
committerGitHub <noreply@github.com>2020-06-03 20:32:15 +0200
commitf669b8bcceb5043e468b3319c0bb7e834e3892d4 (patch)
treebac7086e8b7a9fecdcc41402e674cdbca363d237
parent77619b165452dd2815748c59e16451605b457ed6 (diff)
Fix wrong route helper in encrypted messages controller (#13952)
And add `created_at` to encrypted message serializer
-rw-r--r--app/controllers/api/v1/crypto/encrypted_messages_controller.rb4
-rw-r--r--app/serializers/rest/encrypted_message_serializer.rb3
2 files changed, 4 insertions, 3 deletions
diff --git a/app/controllers/api/v1/crypto/encrypted_messages_controller.rb b/app/controllers/api/v1/crypto/encrypted_messages_controller.rb
index a67b03eb4..c764915e5 100644
--- a/app/controllers/api/v1/crypto/encrypted_messages_controller.rb
+++ b/app/controllers/api/v1/crypto/encrypted_messages_controller.rb
@@ -34,11 +34,11 @@ class Api::V1::Crypto::EncryptedMessagesController < Api::BaseController
   end
 
   def next_path
-    api_v1_encrypted_messages_url pagination_params(max_id: pagination_max_id) if records_continue?
+    api_v1_crypto_encrypted_messages_url pagination_params(max_id: pagination_max_id) if records_continue?
   end
 
   def prev_path
-    api_v1_encrypted_messages_url pagination_params(min_id: pagination_since_id) unless @encrypted_messages.empty?
+    api_v1_crypto_encrypted_messages_url pagination_params(min_id: pagination_since_id) unless @encrypted_messages.empty?
   end
 
   def pagination_max_id
diff --git a/app/serializers/rest/encrypted_message_serializer.rb b/app/serializers/rest/encrypted_message_serializer.rb
index 61ebc74fa..80c26d060 100644
--- a/app/serializers/rest/encrypted_message_serializer.rb
+++ b/app/serializers/rest/encrypted_message_serializer.rb
@@ -2,7 +2,8 @@
 
 class REST::EncryptedMessageSerializer < ActiveModel::Serializer
   attributes :id, :account_id, :device_id,
-             :type, :body, :digest, :message_franking
+             :type, :body, :digest, :message_franking,
+             :created_at
 
   def id
     object.id.to_s