mirror of
https://github.com/Buriburizaem0n/admin-frontend-domain.git
synced 2026-09-19 09:40:13 +00:00
implement notification page (#8)
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
import { ModelAlertRuleForm } from "@/types"
|
||||
import { fetcher, FetcherMethod } from "./api"
|
||||
|
||||
export const createAlertRule = async (data: ModelAlertRuleForm): Promise<number> => {
|
||||
return fetcher<number>(FetcherMethod.POST, '/api/v1/alert-rule', data);
|
||||
}
|
||||
|
||||
export const updateAlertRule = async (id: number, data: ModelAlertRuleForm): Promise<void> => {
|
||||
return fetcher<void>(FetcherMethod.PATCH, `/api/v1/alert-rule/${id}`, data);
|
||||
}
|
||||
|
||||
export const deleteAlertRules = async (id: number[]): Promise<void> => {
|
||||
return fetcher<void>(FetcherMethod.POST, '/api/v1/batch-delete/alert-rule', id);
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ModelNotificationGroupForm } from "@/types"
|
||||
import { ModelNotificationGroupForm, ModelNotificationGroupResponseItem } from "@/types"
|
||||
import { fetcher, FetcherMethod } from "./api"
|
||||
|
||||
export const createNotificationGroup = async (data: ModelNotificationGroupForm): Promise<number> => {
|
||||
@@ -12,3 +12,7 @@ export const updateNotificationGroup = async (id: number, data: ModelNotificatio
|
||||
export const deleteNotificationGroups = async (id: number[]): Promise<void> => {
|
||||
return fetcher<void>(FetcherMethod.POST, `/api/v1/batch-delete/notification-group`, id);
|
||||
}
|
||||
|
||||
export const getNotificationGroups = async (): Promise<ModelNotificationGroupResponseItem[]> => {
|
||||
return fetcher<ModelNotificationGroupResponseItem[]>(FetcherMethod.GET, '/api/v1/notification-group', null);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
import { ModelNotificationForm, ModelNotification } from "@/types"
|
||||
import { fetcher, FetcherMethod } from "./api"
|
||||
|
||||
export const createNotification = async (data: ModelNotificationForm): Promise<number> => {
|
||||
return fetcher<number>(FetcherMethod.POST, '/api/v1/notification', data);
|
||||
}
|
||||
|
||||
export const updateNotification = async (id: number, data: ModelNotificationForm): Promise<void> => {
|
||||
return fetcher<void>(FetcherMethod.PATCH, `/api/v1/notification/${id}`, data);
|
||||
}
|
||||
|
||||
export const deleteNotification = async (id: number[]): Promise<void> => {
|
||||
return fetcher<void>(FetcherMethod.POST, '/api/v1/batch-delete/notification', id);
|
||||
}
|
||||
|
||||
export const getNotification = async (): Promise<ModelNotification[]> => {
|
||||
return fetcher<ModelNotification[]>(FetcherMethod.GET, '/api/v1/notification', null);
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import { ModelTerminalForm, ModelCreateTerminalResponse } from "@/types";
|
||||
import { ModelCreateTerminalResponse } from "@/types";
|
||||
import { fetcher, FetcherMethod } from "./api"
|
||||
|
||||
export const createTerminal = async (id: number): Promise<ModelCreateTerminalResponse> => {
|
||||
|
||||
Reference in New Issue
Block a user