mirror of
https://github.com/Buriburizaem0n/admin-frontend-domain.git
synced 2026-09-19 17:50:13 +00:00
implement group page (#6)
* implement group page * group state, search box * rename some field * update api types
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import { ModelServerGroupForm, ModelServerGroupResponseItem } from "@/types"
|
||||
import { fetcher, FetcherMethod } from "./api"
|
||||
|
||||
export const createServerGroup = async (data: ModelServerGroupForm): Promise<number> => {
|
||||
return fetcher<number>(FetcherMethod.POST, '/api/v1/server-group', data);
|
||||
}
|
||||
|
||||
export const updateServerGroup = async (id: number, data: ModelServerGroupForm): Promise<void> => {
|
||||
return fetcher<void>(FetcherMethod.PATCH, `/api/v1/server-group/${id}`, data);
|
||||
}
|
||||
|
||||
export const deleteServerGroups = async (id: number[]): Promise<void> => {
|
||||
return fetcher<void>(FetcherMethod.POST, `/api/v1/batch-delete/server-group`, id)
|
||||
}
|
||||
|
||||
export const getServerGroups = async (): Promise<ModelServerGroupResponseItem[]> => {
|
||||
return fetcher<ModelServerGroupResponseItem[]>(FetcherMethod.GET, '/api/v1/server-group', null)
|
||||
}
|
||||
Reference in New Issue
Block a user