add store

This commit is contained in:
Timi
2026-08-07 11:32:48 +08:00
parent 9df6dfaf59
commit fab3cd8891
21 changed files with 1355 additions and 31 deletions
+7 -4
View File
@@ -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> {