Skip to content

Commit

Permalink
Merge pull request #840 from commercelayer/filters
Browse files Browse the repository at this point in the history
Improve types for `parseFormValue` method in `useResourceFilters`
  • Loading branch information
gciotola authored Nov 27, 2024
2 parents debb0ec + cb2216d commit 23fd5fb
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { type InputCurrencyRangeProps } from '#ui/forms/InputCurrencyRange'
import { type InputResourceGroupProps } from '#ui/forms/InputResourceGroup'
import { type QueryFilter } from '@commercelayer/sdk'
import { type ValueOf } from 'type-fest'

export const filterableTimeRangePreset = [
'today',
Expand Down Expand Up @@ -67,7 +69,7 @@ export interface BaseFilterItem {
/**
* Custom function to transform the form value to the SDK value
*/
parseFormValue?: (value: unknown) => string | number | boolean | undefined
parseFormValue?: (value: unknown) => ValueOf<QueryFilter> | undefined
}
}

Expand Down

0 comments on commit 23fd5fb

Please sign in to comment.