From 672f700271ee935ea9f6bf66802517e720c3c097 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Sun, 17 Sep 2023 22:50:42 -0700 Subject: feat(notifications): link to activity --- src/lib/AniList/notifications.ts | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) (limited to 'src/lib/AniList') diff --git a/src/lib/AniList/notifications.ts b/src/lib/AniList/notifications.ts index b236e994..42b4c84b 100644 --- a/src/lib/AniList/notifications.ts +++ b/src/lib/AniList/notifications.ts @@ -28,12 +28,20 @@ export interface Notification { } export const notifications = async (accessToken: string): Promise => { - const activityNotification = (type: string) => `... on ${type} { - id user { name avatar { large } } context createdAt type - }`; - const threadNotification = (type: string) => `... on ${type} { - id user { name avatar { large } } context createdAt type thread { title id } + const activityNotification = (type: string, extend = '') => `... on ${type} { + id user { name avatar { large } } context createdAt type ${extend} }`; + const richActivityNotification = (type: string) => + `${activityNotification( + type, + `activity { + ... on TextActivity { id } + ... on ListActivity { id } + ... on MessageActivity { id } + }` + )}`; + const threadNotification = (type: string) => + `${activityNotification(type, `thread { title id }`)}`; return ( await ( @@ -48,11 +56,11 @@ export const notifications = async (accessToken: string): Promise