Skip to content

Commit c7572a8

Browse files
committed
Fix tests
1 parent eaaae9a commit c7572a8

File tree

2 files changed

+1
-21
lines changed

2 files changed

+1
-21
lines changed

assets/js/api-search/src/reducer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export default (state, action) => {
3434
newState.args = { ...newState.args, ...args, offset: 0 };
3535
newState.isOn = true;
3636

37-
if (updateDefaults && args.post_type.length) {
37+
if (updateDefaults && args.post_type?.length) {
3838
newState.argsSchema.post_type.default = args.post_type;
3939
}
4040

assets/js/instant-results/utilities.js

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -36,26 +36,6 @@ export const formatPrice = (number, options) => {
3636
return format.format(number);
3737
};
3838

39-
/**
40-
* Get the post types from a search form.
41-
*
42-
* @param {HTMLFormElement} form Form element.
43-
* @returns {Array} Post types.
44-
*/
45-
export const getPostTypesFromForm = (form) => {
46-
const data = new FormData(form);
47-
48-
if (data.has('post_type')) {
49-
return data.getAll('post_type').slice(-1);
50-
}
51-
52-
if (data.has('post_type[]')) {
53-
return data.getAll('post_type[]');
54-
}
55-
56-
return [];
57-
};
58-
5939
/**
6040
* Get search args from a search form for Instant Results.
6141
*

0 commit comments

Comments
 (0)