diff options
| author | Fuwn <[email protected]> | 2024-07-25 00:13:29 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-07-25 00:13:29 -0700 |
| commit | 3375311c1b92f615940412bb89ce81f644753996 (patch) | |
| tree | 7c8143bc368f64481246d91a329606bb876f7682 /src/lib/Database | |
| parent | fix(Settings): hint wording (diff) | |
| download | due.moe-3375311c1b92f615940412bb89ce81f644753996.tar.xz due.moe-3375311c1b92f615940412bb89ce81f644753996.zip | |
feat(notifications): allow unsubscribe
Diffstat (limited to 'src/lib/Database')
| -rw-r--r-- | src/lib/Database/userNotifications.ts | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/lib/Database/userNotifications.ts b/src/lib/Database/userNotifications.ts index c61c2aa7..6516b813 100644 --- a/src/lib/Database/userNotifications.ts +++ b/src/lib/Database/userNotifications.ts @@ -18,6 +18,9 @@ export const getUserSubscriptions = async () => { return data as UserNotifications[]; }; +export const deleteUserSubscription = async (userId: number) => + await supabase.from('user_notifications').delete().eq('user_id', userId); + export const setUserSubscription = async (userId: number, subscription: JSON) => await supabase.from('user_notifications').upsert( { |