File tree Expand file tree Collapse file tree
typescript/src/shared/product-search Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ " @commercetools/mcp-essentials " : minor
3+ " @commercetools/agent-essentials " : minor
4+ ---
5+
6+ Added [ fieldType] ( https://docs.commercetools.com/api/search-query-language#ctp:api:type:SearchFieldType ) to search_products
7+
8+ Necessary when sorting by attributes to avoid errors like: ` SDKError: Failed to search products Field [variants.attributes.weight]: Type is missing `
Original file line number Diff line number Diff line change @@ -18,6 +18,35 @@ export const searchProductsParameters = z.object({
1818 . enum ( [ 'min' , 'max' ] )
1919 . optional ( )
2020 . describe ( 'The sorting mode for multi-valued fields' ) ,
21+ fieldType : z
22+ . enum ( [
23+ 'boolean' ,
24+ 'text' ,
25+ 'ltext' ,
26+ 'enum' ,
27+ 'lenum' ,
28+ 'number' ,
29+ 'money' ,
30+ 'date' ,
31+ 'datetime' ,
32+ 'time' ,
33+ 'reference' ,
34+ 'set_boolean' ,
35+ 'set_text' ,
36+ 'set_ltext' ,
37+ 'set_enum' ,
38+ 'set_lenum' ,
39+ 'set_number' ,
40+ 'set_money' ,
41+ 'set_date' ,
42+ 'set_datetime' ,
43+ 'set_time' ,
44+ 'set_reference' ,
45+ ] )
46+ . optional ( )
47+ . describe (
48+ 'The data type of the field. Must be provided when field is a non-standard field on a resource, like a Product Attribute'
49+ ) ,
2150 } )
2251 )
2352 . optional ( )
You can’t perform that action at this time.
0 commit comments