refactor: 统一前端业务提供项命名

This commit is contained in:
que01 committed 2026-09-21 18:00:20 +08:00
1 parent 88cd8df40e
commit a374614313
3 files changed
+23 -24

No files matched your search

+9 -10
View File
@@ -3,10 +3,10 @@ import type {
BookingStatus,
ContactPreference,
FulfillmentType,
PublicService,
PublicOffering,
BrandTemplateKey,
} from "@personal-brand/types";
export type { PublicService } from "@personal-brand/types";
export type { PublicOffering } from "@personal-brand/types";
export type { BookingStatus } from "@personal-brand/types";
export interface BrandProfile {
@@ -25,7 +25,7 @@ export interface BrandProfile {
config?: Record<string, unknown> | null;
}
export type BrandUpdate = Partial<Omit<BrandProfile, "id">>;
export interface ServiceUpdate {
export interface OfferingUpdate {
name?: string;
description?: string;
coverUrl?: string;
@@ -37,7 +37,6 @@ export interface ServiceUpdate {
categoryKey?: string;
config?: Record<string, unknown>;
}
export type OfferingUpdate = ServiceUpdate;
export interface TrustContent {
id: string;
type: string;
@@ -271,7 +270,7 @@ export class ApiClient {
getBrand(): Promise<BrandProfile> {
return this.request("/public/brand");
}
listServices(): Promise<PublicService[]> {
listOfferings(): Promise<PublicOffering[]> {
return this.request("/public/offerings");
}
getPublicWorkspace(): Promise<PublicWorkspace> {
@@ -440,19 +439,19 @@ export class ApiClient {
body,
});
}
updateAdminService(id: string, body: ServiceUpdate): Promise<PublicService> {
updateAdminOfferingCompat(id: string, body: OfferingUpdate): Promise<PublicOffering> {
const { categoryKey, ...rest } = body;
return this.request(`/admin/workspace/offerings/${encodeURIComponent(id)}`, {
method: "PATCH",
body: { ...rest, ...(categoryKey ? { kind: categoryKey } : {}) },
});
}
listAdminServices(): Promise<PublicService[]> {
listAdminOfferingsCompat(): Promise<PublicOffering[]> {
return this.request("/admin/workspace/offerings");
}
createAdminService(
body: ServiceUpdate & { name: string; description: string },
): Promise<PublicService> {
createAdminOfferingCompat(
body: OfferingUpdate & { name: string; description: string },
): Promise<PublicOffering> {
const { categoryKey, bookingEnabled: _bookingEnabled, ...rest } = body;
return this.request("/admin/workspace/offerings", {
method: "POST",