forked from mastodon/mastodon
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'mastodon:main' into main
- Loading branch information
Showing
145 changed files
with
616 additions
and
511 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { | ||
apiGetNotificationPolicy, | ||
apiUpdateNotificationsPolicy, | ||
} from 'mastodon/api/notification_policies'; | ||
import type { NotificationPolicy } from 'mastodon/models/notification_policy'; | ||
import { createDataLoadingThunk } from 'mastodon/store/typed_functions'; | ||
|
||
export const fetchNotificationPolicy = createDataLoadingThunk( | ||
'notificationPolicy/fetch', | ||
() => apiGetNotificationPolicy(), | ||
); | ||
|
||
export const updateNotificationsPolicy = createDataLoadingThunk( | ||
'notificationPolicy/update', | ||
(policy: Partial<NotificationPolicy>) => apiUpdateNotificationsPolicy(policy), | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { apiRequest } from 'mastodon/api'; | ||
import type { NotificationPolicyJSON } from 'mastodon/api_types/notification_policies'; | ||
|
||
export const apiGetNotificationPolicy = () => | ||
apiRequest<NotificationPolicyJSON>('GET', '/v1/notifications/policy'); | ||
|
||
export const apiUpdateNotificationsPolicy = ( | ||
policy: Partial<NotificationPolicyJSON>, | ||
) => | ||
apiRequest<NotificationPolicyJSON>('PUT', '/v1/notifications/policy', policy); |
Oops, something went wrong.