fix: 修正小程序配置表单实例归属
This commit is contained in:
1 parent
8c5860699f
commit
a293591dba
3 files changed
+17
-31
No files matched your search
@@ -1,5 +1,5 @@
|
||||
import { useEffect } from "react";
|
||||
import { Alert, Button, Form, Input, Space } from "antd";
|
||||
import type { FormInstance } from "antd";
|
||||
import type { MiniAppReleaseSettings } from "@personal-brand/api-client";
|
||||
import { AdminSection } from "../../components/AdminSection.js";
|
||||
import { MutationError } from "../../components/QueryState.js";
|
||||
@@ -12,20 +12,24 @@ export type MiniAppSettingsValues = {
|
||||
};
|
||||
|
||||
interface MiniAppSettingsTabProps {
|
||||
form: FormInstance<MiniAppSettingsValues>;
|
||||
settings: MiniAppReleaseSettings | undefined;
|
||||
saving: boolean;
|
||||
error?: unknown;
|
||||
onSave: (values: MiniAppSettingsValues) => void;
|
||||
}
|
||||
|
||||
export function MiniAppSettingsTab({
|
||||
form,
|
||||
settings,
|
||||
saving,
|
||||
error,
|
||||
onSave,
|
||||
}: MiniAppSettingsTabProps) {
|
||||
export function MiniAppSettingsTab({ settings, saving, error, onSave }: MiniAppSettingsTabProps) {
|
||||
const [form] = Form.useForm<MiniAppSettingsValues>();
|
||||
|
||||
useEffect(() => {
|
||||
if (!settings) return;
|
||||
form.setFieldsValue({
|
||||
appId: settings.appId,
|
||||
apiBaseUrl: settings.apiBaseUrl,
|
||||
privateKey: "",
|
||||
});
|
||||
}, [form, settings]);
|
||||
|
||||
return (
|
||||
<div className="admin-stack admin-stack-lg">
|
||||
<AdminSection
|
||||
|
||||
Reference in new issue
Block a user