add store
This commit is contained in:
+7
-4
@@ -1,14 +1,17 @@
|
||||
import { axios, type Page, type PageResult } from "timi-web";
|
||||
import type { EventItem } from "@/types/EventItem";
|
||||
import { getCurrentStoreId, withCurrentStoreId, withCurrentStorePage } from "@/utils/store";
|
||||
|
||||
const BASE_URI = "/gao/event";
|
||||
|
||||
async function list(req: Page<EventItem>): Promise<PageResult<EventItem>> {
|
||||
return await axios.post(`${BASE_URI}/list`, req);
|
||||
return await axios.post(`${BASE_URI}/list`, withCurrentStorePage(req));
|
||||
}
|
||||
|
||||
async function listValid(): Promise<EventItem[]> {
|
||||
return await axios.post(`${BASE_URI}/list/valid`);
|
||||
return await axios.post(`${BASE_URI}/list/valid`, undefined, {
|
||||
params: { storeId: getCurrentStoreId() }
|
||||
});
|
||||
}
|
||||
|
||||
async function detail(id: string): Promise<EventItem> {
|
||||
@@ -18,11 +21,11 @@ async function detail(id: string): Promise<EventItem> {
|
||||
}
|
||||
|
||||
async function create(event: EventItem): Promise<void> {
|
||||
return await axios.post(`${BASE_URI}/create`, event);
|
||||
return await axios.post(`${BASE_URI}/create`, withCurrentStoreId(event));
|
||||
}
|
||||
|
||||
async function update(event: EventItem): Promise<void> {
|
||||
return await axios.post(`${BASE_URI}/update`, event);
|
||||
return await axios.post(`${BASE_URI}/update`, withCurrentStoreId(event));
|
||||
}
|
||||
|
||||
async function sort(idList: string[]): Promise<void> {
|
||||
|
||||
Reference in New Issue
Block a user