feat: 增加后台品牌与服务配置能力
This commit is contained in:
1 parent
34ec893369
commit
f485257e37
4 files changed
+61
-4
No files matched your search
@@ -20,6 +20,8 @@ export interface BrandProfile {
|
||||
contactPhone: string | null;
|
||||
contactWechat: string | null;
|
||||
}
|
||||
export type BrandUpdate = Partial<Omit<BrandProfile, "id">>;
|
||||
export interface ServiceUpdate { name?: string; description?: string; coverUrl?: string; priceText?: string; priceAmount?: number; sortOrder?: number; bookingEnabled?: boolean; isEnabled?: boolean }
|
||||
|
||||
export interface BookingItemInput { serviceId: string; quantity: number }
|
||||
export interface CreateBookingInput {
|
||||
@@ -102,6 +104,9 @@ export class ApiClient {
|
||||
createAdminTag(name: string): Promise<BookingTag> {
|
||||
return this.request("/admin/bookings/tags", { method: "POST", body: { name } });
|
||||
}
|
||||
getAdminBrand(): Promise<BrandProfile> { return this.request("/admin/config/brand"); }
|
||||
updateAdminBrand(body: BrandUpdate): Promise<BrandProfile> { return this.request("/admin/config/brand", { method: "PATCH", body }); }
|
||||
updateAdminService(id: string, body: ServiceUpdate): Promise<PublicService> { return this.request(`/admin/config/services/${encodeURIComponent(id)}`, { method: "PATCH", body }); }
|
||||
private async request<T>(path: string, options: { method?: string; body?: unknown } = {}): Promise<T> {
|
||||
const headers: Record<string, string> = { accept: "application/json" };
|
||||
if (options.body !== undefined) headers["content-type"] = "application/json";
|
||||
|
||||
Reference in new issue
Block a user