33 lines
942 B
TypeScript
33 lines
942 B
TypeScript
|
|
import apiService from '@/services/api.service'
|
||
|
|
import { NotificationRuleDto } from './models'
|
||
|
|
|
||
|
|
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 },
|
||
|
|
})
|