feat: 增加动态咨询表单配置接口
This commit is contained in:
1 parent
46c3e5504e
commit
32d3db90de
4 files changed
+124
No files matched your search
@@ -144,6 +144,14 @@ export interface BrandFieldDefinition {
|
||||
sortOrder: number;
|
||||
source: string;
|
||||
}
|
||||
export interface InquiryForm {
|
||||
id: string;
|
||||
name: string;
|
||||
offeringId?: string | null;
|
||||
version: number;
|
||||
isEnabled: boolean;
|
||||
fieldsSnapshot: unknown[];
|
||||
}
|
||||
export interface Offering {
|
||||
id: string;
|
||||
brandId?: string;
|
||||
@@ -301,6 +309,31 @@ export class ApiClient {
|
||||
deleteAdminField(id: string): Promise<{ deleted: boolean }> {
|
||||
return this.request(`/admin/workspace/fields/${encodeURIComponent(id)}`, { method: "DELETE" });
|
||||
}
|
||||
listAdminInquiryForms(): Promise<InquiryForm[]> {
|
||||
return this.request("/admin/workspace/forms");
|
||||
}
|
||||
createAdminInquiryForm(body: {
|
||||
name: string;
|
||||
offeringId?: string;
|
||||
fieldsSnapshot: unknown[];
|
||||
isEnabled?: boolean;
|
||||
}): Promise<InquiryForm> {
|
||||
return this.request("/admin/workspace/forms", { method: "POST", body });
|
||||
}
|
||||
updateAdminInquiryForm(
|
||||
id: string,
|
||||
body: Partial<{
|
||||
name: string;
|
||||
offeringId: string;
|
||||
fieldsSnapshot: unknown[];
|
||||
isEnabled: boolean;
|
||||
}>,
|
||||
): Promise<InquiryForm> {
|
||||
return this.request(`/admin/workspace/forms/${encodeURIComponent(id)}`, {
|
||||
method: "PATCH",
|
||||
body,
|
||||
});
|
||||
}
|
||||
listAdminOfferings(): Promise<Offering[]> {
|
||||
return this.request("/admin/workspace/offerings");
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user