feat: 接入后台信任内容管理页面
This commit is contained in:
1 parent
f29e64724d
commit
ad70eef8eb
2 files changed
+18
-3
No files matched your search
@@ -24,6 +24,8 @@ export interface BrandProfile {
|
||||
}
|
||||
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; categoryKey?: string; config?: Record<string, unknown> }
|
||||
export interface TrustContent { id: string; type: string; title: string; summary?: string | null; content: string; coverUrl?: string | null; sortOrder: number; isPublished: boolean; config?: Record<string, unknown> | null }
|
||||
export interface TrustContentInput { type: string; title: string; summary?: string; content: string; coverUrl?: string; sortOrder?: number; isPublished?: boolean; config?: Record<string, unknown> }
|
||||
|
||||
export interface BookingItemInput { serviceId: string; quantity: number }
|
||||
export interface CreateBookingInput {
|
||||
@@ -111,6 +113,10 @@ export class ApiClient {
|
||||
updateAdminService(id: string, body: ServiceUpdate): Promise<PublicService> { return this.request(`/admin/config/services/${encodeURIComponent(id)}`, { method: "PATCH", body }); }
|
||||
listAdminServices(): Promise<PublicService[]> { return this.request("/admin/config/services"); }
|
||||
createAdminService(body: ServiceUpdate & { name: string; description: string }): Promise<PublicService> { return this.request("/admin/config/services", { method: "POST", body }); }
|
||||
listAdminTrustContent(): Promise<TrustContent[]> { return this.request("/admin/config/trust-content"); }
|
||||
createAdminTrustContent(body: TrustContentInput): Promise<TrustContent> { return this.request("/admin/config/trust-content", { method: "POST", body }); }
|
||||
updateAdminTrustContent(id: string, body: Partial<TrustContentInput>): Promise<TrustContent> { return this.request(`/admin/config/trust-content/${encodeURIComponent(id)}`, { method: "PATCH", body }); }
|
||||
deleteAdminTrustContent(id: string): Promise<{ deleted: boolean }> { return this.request(`/admin/config/trust-content/${encodeURIComponent(id)}`, { method: "DELETE" }); }
|
||||
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