update
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
import { axios } from "./BaseAPI";
|
||||
import type { Page, PageResult, Permission, PermissionPayload } from "../types";
|
||||
|
||||
const BASE_URI = "/user/permission";
|
||||
|
||||
async function list(req: Page<Permission>): Promise<PageResult<Permission>> {
|
||||
return axios.post(`${BASE_URI}/list`, req);
|
||||
}
|
||||
|
||||
async function create(req: PermissionPayload): Promise<void> {
|
||||
return axios.post(`${BASE_URI}/create`, req);
|
||||
}
|
||||
|
||||
async function update(req: PermissionPayload): Promise<void> {
|
||||
return axios.post(`${BASE_URI}/update`, req);
|
||||
}
|
||||
|
||||
async function remove(id: string): Promise<void> {
|
||||
return axios.post(`${BASE_URI}/delete`, undefined, {
|
||||
params: { id }
|
||||
});
|
||||
}
|
||||
|
||||
export default {
|
||||
list,
|
||||
create,
|
||||
update,
|
||||
remove
|
||||
};
|
||||
Reference in New Issue
Block a user