Skip to content

Commit

Permalink
feat: use new open forms public api
Browse files Browse the repository at this point in the history
  • Loading branch information
bddjong authored and AliKdhim87 committed Jun 3, 2024
1 parent 4e4aa64 commit b8dcf4c
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function CustomCombobox({
const [isLoading, setIsLoading] = useState(false);

const { config } = usePluginConfig();
const apiUrl = config?.api_url?.endsWith('/') ? `${config?.api_url}forms` : `${config?.api_url}/forms`;
const apiUrl = config?.api_url?.endsWith('/') ? `${config?.api_url}public/forms` : `${config?.api_url}/public/forms`;
const fetchAllOpenForms = async () => {
setIsLoading(true);
try {
Expand All @@ -51,8 +51,8 @@ function CustomCombobox({
Authorization: `Token ${config.token}`,
},
});
const data = await response.json();
setOpenForms(data);
const { results } = await response.json();
setOpenForms(results);
setIsLoading(false);
} catch (error) {
// eslint-disable-next-line no-console
Expand Down

0 comments on commit b8dcf4c

Please sign in to comment.