]> cat aescling's git repositories - mastodon.git/commitdiff
Fix wrong route helper in encrypted messages controller (#13952)
authorEugen Rochko <eugen@zeonfederated.com>
Wed, 3 Jun 2020 18:32:15 +0000 (20:32 +0200)
committerGitHub <noreply@github.com>
Wed, 3 Jun 2020 18:32:15 +0000 (20:32 +0200)
And add `created_at` to encrypted message serializer

app/controllers/api/v1/crypto/encrypted_messages_controller.rb
app/serializers/rest/encrypted_message_serializer.rb

index a67b03eb4f277f2a7c3eedae1971b61f9bd1181b..c764915e578e19dbd249fdcf503b7c8827079e6a 100644 (file)
@@ -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
index 61ebc74fa4687d08dd1257f6e82b5680ca0138f3..80c26d060ea32f0ba6db0251b2b7af979b9e496e 100644 (file)
@@ -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