Skip to content

Commit

Permalink
Fix: Enhance Donation Form block to display up to 100 forms (#7347)
Browse files Browse the repository at this point in the history
  • Loading branch information
pauloiankoski authored Apr 10, 2024
1 parent f9672ea commit 57ac936
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export interface FormOption extends Form {
}

/**
* @unreleased Increase the per_page attribute to 100 to accommodate for more forms.
* @since 3.2.0 include isLegacyForm, isLegacyFormTemplate & link.
* @since 3.0.0
*/
Expand All @@ -22,11 +23,16 @@ export default function useFormOptions(): {
const formOptions = [];

const {forms, isResolving} = useSelect((select) => {
const query = {per_page: 100};
return {
// @ts-ignore
forms: select('core').getEntityRecords<Post[]>('postType', 'give_forms'),
forms: select('core').getEntityRecords<Post[]>('postType', 'give_forms', query),
// @ts-ignore
isResolving: select('core/data').getIsResolving('core', 'getEntityRecords', ['postType', 'give_forms']),
isResolving: select('core/data').getIsResolving('core', 'getEntityRecords', [
'postType',
'give_forms',
query,
]),
};
}, []);

Expand Down

0 comments on commit 57ac936

Please sign in to comment.