From da2ef4d676ff71e6ab3edf8d1a7cee8bf6b6d353 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sun, 20 Nov 2016 00:33:02 +0100 Subject: Adding unified streamable notifications --- app/views/api/v1/notifications/index.rabl | 2 ++ app/views/api/v1/notifications/show.rabl | 11 +++++++++++ 2 files changed, 13 insertions(+) create mode 100644 app/views/api/v1/notifications/index.rabl create mode 100644 app/views/api/v1/notifications/show.rabl (limited to 'app/views/api/v1') diff --git a/app/views/api/v1/notifications/index.rabl b/app/views/api/v1/notifications/index.rabl new file mode 100644 index 000000000..6abc3da36 --- /dev/null +++ b/app/views/api/v1/notifications/index.rabl @@ -0,0 +1,2 @@ +collection @notifications +extends 'api/v1/notifications/show' diff --git a/app/views/api/v1/notifications/show.rabl b/app/views/api/v1/notifications/show.rabl new file mode 100644 index 000000000..fe2218ed7 --- /dev/null +++ b/app/views/api/v1/notifications/show.rabl @@ -0,0 +1,11 @@ +object @notification + +attributes :id, :type + +child from_account: :account do + extends 'api/v1/accounts/show' +end + +node(:status, if: lambda { |n| [:favourite, :reblog, :mention].include?(n.type) }) do |n| + partial 'api/v1/statuses/show', object: n.target_status +end -- cgit