api fixes for list filters
This commit is contained in:
@ -9,6 +9,7 @@ import (
|
||||
|
||||
"git.loyso.art/frx/kurious/internal/common/client/sravni"
|
||||
"git.loyso.art/frx/kurious/internal/common/errors"
|
||||
"git.loyso.art/frx/kurious/internal/common/xslice"
|
||||
|
||||
"github.com/teris-io/cli"
|
||||
)
|
||||
@ -184,7 +185,13 @@ func (a *productsFilterCountAction) parse(args []string, options map[string]stri
|
||||
return errors.SimpleError(learningTypeOptName + " is empty")
|
||||
}
|
||||
|
||||
a.params.courseThematic = strings.Split(options[courseThematicOptName], ",")
|
||||
filterNotEmpty := func(value string) bool {
|
||||
return value != ""
|
||||
}
|
||||
a.params.courseThematic = xslice.Filter(
|
||||
strings.Split(options[courseThematicOptName], ","),
|
||||
filterNotEmpty,
|
||||
)
|
||||
a.params.learningSelectionType = options[learningTypeSelectionOptName]
|
||||
|
||||
client, err := makeSravniClient(a.ctx, a.log, options)
|
||||
|
||||
@ -276,7 +276,7 @@ func (c *client) ListEducationalProductsFilterCount(
|
||||
ctx context.Context,
|
||||
params ListEducationProductsParams,
|
||||
) (result ProductsFilterCount, err error) {
|
||||
const urlPath = "/v2/education/prodicts/fitter/count"
|
||||
const urlPath = "/v2/education/products/filter/count"
|
||||
if err = c.checkClientInited(); err != nil {
|
||||
return result, err
|
||||
}
|
||||
@ -307,7 +307,7 @@ func (c *client) ListEducationalProductsFilterCount(
|
||||
var respData DataContainer[ProductsFilterCount]
|
||||
resp, err := c.http.R().
|
||||
SetBody(reqParams).
|
||||
SetResult(&result).
|
||||
SetResult(&respData).
|
||||
EnableTrace().
|
||||
Post(c.makeEducationURL(urlPath))
|
||||
if err != nil {
|
||||
|
||||
@ -130,7 +130,7 @@ type ReduxConfigSorting struct {
|
||||
|
||||
type ReduxConfig struct {
|
||||
Default struct {
|
||||
SortingParameters []string `json:"sortingParameters"`
|
||||
SortingParameters []ReduxConfigSorting `json:"sortingParameters"`
|
||||
} `json:"default"`
|
||||
DataSources map[string]ReduxDataSource `json:"dataSources"`
|
||||
Dictionaries struct {
|
||||
|
||||
Reference in New Issue
Block a user