Introduction
Products is a separate module in the Headless CMS OneEntry interface that allows you to create a product catalog or a set of multimedia elements, such as a gallery.
const config = {
token:'your-app-token',
};
const { Products } = defineOneEntry('your-url', config);
This module accepts a set of user parameters called userQuery. If the parameters are not passed to the method, the default value will be applied. Some methods accept the body as a parameter for filtering. If you don't want to set up sorting, pass an empty array or don't pass anything. Parameters:
const userQuery = {
offset: 0,
limit: 30,
sortOrder: 'DESC',
sortKey: 'id'
}
Schema
offset: number
pagination parameter, default 0
example: 0
limit: number
pagination parameter, default 30
example: 30
sortKey: string
field for sorting (default not set - sorting by position, possible values: id, title, date, price, position)
Available values : id, position, title, date, price
sortOrder: string
sorting order DESC | ASC (default DESC)
example: "DESC"
"conditionMarker" by which values are filtered (not set by default), possible values:
'in' - Contains,
'nin' - Does not contain,
'eq' - Equal,
'neq' - Not equal,
'mth' - Greater than,
'lth' - Less than,
'exs' - Exists,
'nexs' - Does not exist
.