mirror of
https://github.com/Buriburizaem0n/admin-frontend-domain.git
synced 2026-09-19 09:40:13 +00:00
fix api types, add more form fields
This commit is contained in:
+1
-1
@@ -58,4 +58,4 @@ export async function fetcher<T>(method: FetcherMethod, path: string, data?: any
|
||||
|
||||
export async function swrFetcher<T>(input: string | URL | globalThis.Request, init?: RequestInit) {
|
||||
return fetcher<T>(init?.method as FetcherMethod, input.toString(), init?.body);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
import { ModelServiceForm } from "@/types"
|
||||
import { fetcher, FetcherMethod } from "./api"
|
||||
|
||||
export const createService = async (data: ModelServiceForm): Promise<number> => {
|
||||
return fetcher<number>(FetcherMethod.POST, '/api/v1/profile', data)
|
||||
}
|
||||
|
||||
export const updateService = async (id: number, data: ModelServiceForm): Promise<void> => {
|
||||
return fetcher<void>(FetcherMethod.PATCH, `/api/v1/profile/${id}`, data)
|
||||
}
|
||||
|
||||
export const deleteService = async (id: number[]): Promise<void> => {
|
||||
return fetcher<void>(FetcherMethod.POST, '/api/v1/batch-delete/service', id)
|
||||
}
|
||||
Reference in New Issue
Block a user