Skip to content

Commit 10d5859

Browse files
author
Thomasr
committed
Add woocommerce spec version
1 parent 7059b79 commit 10d5859

File tree

1 file changed

+3
-3
lines changed
  • server/node-service/src/plugins/woocommerce

1 file changed

+3
-3
lines changed

server/node-service/src/plugins/woocommerce/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ const wooCommercePlugin: DataSourcePlugin<any, DataSourceConfigType> = {
7878
icon: "woocommerce.svg",
7979
category: "api",
8080
dataSourceConfig,
81-
queryConfig: async () => {
82-
const { actions, categories } = await parseOpenApi(spec as OpenAPI.Document, parseOptions);
81+
queryConfig: async (data) => {
82+
const { actions, categories } = await parseOpenApi(specs[data.specVersion as keyof typeof specs] as OpenAPI.Document, parseOptions);
8383
return {
8484
type: "query",
8585
label: "Operation",
@@ -98,7 +98,7 @@ const wooCommercePlugin: DataSourcePlugin<any, DataSourceConfigType> = {
9898
dynamicParamsConfig: otherDataSourceConfig,
9999
specVersion: dataSourceConfig.specVersion
100100
};
101-
return runOpenApi(actionData, runApiDsConfig, spec as unknown as OpenAPIV2.Document);
101+
return runOpenApi(actionData, runApiDsConfig, specs[dataSourceConfig.specVersion as keyof typeof specs] as unknown as OpenAPIV2.Document);
102102
},
103103
};
104104

0 commit comments

Comments
 (0)