refactor event
This commit is contained in:
+6
-7
@@ -7,7 +7,7 @@ async function list(req: Page<EventItem>): Promise<PageResult<EventItem>> {
|
||||
return await axios.post(`${BASE_URI}/list`, req);
|
||||
}
|
||||
|
||||
async function enabledList(): Promise<EventItem[]> {
|
||||
async function listValid(): Promise<EventItem[]> {
|
||||
return await axios.post(`${BASE_URI}/list/valid`);
|
||||
}
|
||||
|
||||
@@ -17,12 +17,12 @@ async function detail(id: string): Promise<EventItem> {
|
||||
});
|
||||
}
|
||||
|
||||
async function create(req: EventItem): Promise<void> {
|
||||
return await axios.post(`${BASE_URI}/create`, req);
|
||||
async function create(event: EventItem): Promise<void> {
|
||||
return await axios.post(`${BASE_URI}/create`, event);
|
||||
}
|
||||
|
||||
async function update(req: EventItem): Promise<void> {
|
||||
return await axios.post(`${BASE_URI}/update`, req);
|
||||
async function update(event: EventItem): Promise<void> {
|
||||
return await axios.post(`${BASE_URI}/update`, event);
|
||||
}
|
||||
|
||||
async function sort(idList: string[]): Promise<void> {
|
||||
@@ -37,11 +37,10 @@ async function remove(id: string): Promise<void> {
|
||||
|
||||
export default {
|
||||
list,
|
||||
enabledList,
|
||||
listValid,
|
||||
detail,
|
||||
create,
|
||||
update,
|
||||
sort,
|
||||
remove
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user