2025-08-12 08:39:06 +00:00
|
|
|
import { NotificationRuleDto } from '../proxy/notification/models'
|
|
|
|
|
import apiService from './api.service'
|
2025-05-06 06:45:49 +00:00
|
|
|
|
|
|
|
|
export const getMyNotificationTypes = () =>
|
|
|
|
|
apiService.fetchData<string[]>({
|
|
|
|
|
method: 'GET',
|
|
|
|
|
url: `/api/app/notification-rule/my-notification-types`,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
export const getMyNotificationRules = () =>
|
|
|
|
|
apiService.fetchData<NotificationRuleDto[]>({
|
|
|
|
|
method: 'GET',
|
|
|
|
|
url: `/api/app/notification-rule/my-notification-rules`,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
export const postMyNotificationRule = (data: {
|
|
|
|
|
channel: string
|
|
|
|
|
notificationType: string
|
|
|
|
|
isActive: boolean
|
|
|
|
|
}) =>
|
|
|
|
|
apiService.fetchData<NotificationRuleDto[]>({
|
|
|
|
|
method: 'POST',
|
|
|
|
|
url: `/api/app/notification-rule/my-notification-rule`,
|
|
|
|
|
data,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
export const deleteMyNotificationRules = (notificationType: string) =>
|
|
|
|
|
apiService.fetchData<NotificationRuleDto[]>({
|
|
|
|
|
method: 'DELETE',
|
|
|
|
|
url: `/api/app/notification-rule/my-notification-rules`,
|
|
|
|
|
params: { notificationType },
|
|
|
|
|
})
|