about summary refs log tree commit diff
path: root/app/views/api/v1/notifications
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/api/v1/notifications')
-rw-r--r--app/views/api/v1/notifications/index.rabl2
-rw-r--r--app/views/api/v1/notifications/show.rabl11
2 files changed, 13 insertions, 0 deletions
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