fix(web): fix generate and parse config methods broken in #1465 (#1476)

This commit is contained in:
Mg Pig
2025-10-14 15:13:20 +08:00
committed by GitHub
parent 5292b87275
commit 8cc9da9d6d

View File

@@ -221,7 +221,7 @@ class WebRemoteClient implements Api.RemoteClient {
}
async generate_config(config: NetworkTypes.NetworkConfig): Promise<Api.GenerateConfigResponse> {
try {
const response = await this.client.post<any, GenerateConfigResponse>('/generate-config', config);
const response = await this.client.post<any, GenerateConfigResponse>('/generate-config', { config });
return response;
} catch (error) {
if (error instanceof AxiosError) {
@@ -232,7 +232,7 @@ class WebRemoteClient implements Api.RemoteClient {
}
async parse_config(toml_config: string): Promise<Api.ParseConfigResponse> {
try {
const response = await this.client.post<any, ParseConfigResponse>('/parse-config', toml_config);
const response = await this.client.post<any, ParseConfigResponse>('/parse-config', { toml_config });
return response;
} catch (error) {
if (error instanceof AxiosError) {