feat: add notification settings tab in organization settings for owners and admins
This commit is contained in:
22
lib/api/notification-settings.ts
Normal file
22
lib/api/notification-settings.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* @file Notification settings API client
|
||||
*/
|
||||
|
||||
import apiRequest from './client'
|
||||
|
||||
export interface NotificationSettingsResponse {
|
||||
settings: Record<string, boolean>
|
||||
categories: { id: string; label: string; description: string }[]
|
||||
}
|
||||
|
||||
export async function getNotificationSettings(): Promise<NotificationSettingsResponse> {
|
||||
return apiRequest<NotificationSettingsResponse>('/notification-settings')
|
||||
}
|
||||
|
||||
export async function updateNotificationSettings(settings: Record<string, boolean>): Promise<void> {
|
||||
return apiRequest<void>('/notification-settings', {
|
||||
method: 'PATCH',
|
||||
body: JSON.stringify({ settings }),
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user