diff --git a/src/formkit/inputs/post-select.ts b/src/formkit/inputs/post-select.ts index 9258a4a9..d6edc8c1 100644 --- a/src/formkit/inputs/post-select.ts +++ b/src/formkit/inputs/post-select.ts @@ -1,16 +1,21 @@ +import { postLabels } from "@/constants/labels"; import { apiClient } from "@/utils/api-client"; import type { FormKitNode, FormKitTypeDefinition } from "@formkit/core"; import { select, selects, defaultIcon } from "@formkit/inputs"; function optionsHandler(node: FormKitNode) { node.on("created", async () => { - const { data } = - await apiClient.extension.post.listcontentHaloRunV1alpha1Post(); + const { data } = await apiClient.post.listPosts({ + labelSelector: [ + `${postLabels.DELETED}=false`, + `${postLabels.PUBLISHED}=true`, + ], + }); node.props.options = data.items.map((post) => { return { - value: post.metadata.name, - label: post.spec.title, + value: post.post.metadata.name, + label: post.post.spec.title, }; }); }); diff --git a/src/formkit/inputs/singlePage-select.ts b/src/formkit/inputs/singlePage-select.ts index 738c3d8f..79070f46 100644 --- a/src/formkit/inputs/singlePage-select.ts +++ b/src/formkit/inputs/singlePage-select.ts @@ -1,16 +1,21 @@ +import { singlePageLabels } from "@/constants/labels"; import { apiClient } from "@/utils/api-client"; import type { FormKitNode, FormKitTypeDefinition } from "@formkit/core"; import { select, selects, defaultIcon } from "@formkit/inputs"; function optionsHandler(node: FormKitNode) { node.on("created", async () => { - const { data } = - await apiClient.extension.singlePage.listcontentHaloRunV1alpha1SinglePage(); + const { data } = await apiClient.singlePage.listSinglePages({ + labelSelector: [ + `${singlePageLabels.DELETED}=false`, + `${singlePageLabels.PUBLISHED}=true`, + ], + }); node.props.options = data.items.map((singlePage) => { return { - value: singlePage.metadata.name, - label: singlePage.spec.title, + value: singlePage.page.metadata.name, + label: singlePage.page.spec.title, }; }); });