Skip to content

Commit

Permalink
add sort on cloud and access (#25)
Browse files Browse the repository at this point in the history
* add sort on cloud and access

* merge main

---------

Co-authored-by: Pauline ESPALIEU <[email protected]>
  • Loading branch information
Pauline Espalieu and Pauline ESPALIEU authored Aug 27, 2024
1 parent 0325fdf commit 152336c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 2 additions & 0 deletions internal/data_sources/access_products_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,12 @@ func (d *accessProductsDataSource) Read(ctx context.Context, req datasource.Read
resp.Diagnostics.AddError("error getting filters", err.Error())
}
filterStrings = append(filterStrings, filtersToAdd...)
sortStrings := getSortString(data.Sort)

// Define the search request
searchRequest := &meilisearch.SearchRequest{
Filter: filterStrings,
Sort: sortStrings,
Facets: []string{
"location",
"bandwidth",
Expand Down
2 changes: 2 additions & 0 deletions internal/data_sources/cloud_product_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,12 @@ func (d *cloudProductDataSource) Read(ctx context.Context, req datasource.ReadRe
if err != nil {
resp.Diagnostics.AddError("error getting filters", err.Error())
}
sortStrings := getSortString(data.Sort)

// Define the search request
searchRequest := &meilisearch.SearchRequest{
Filter: filtersStrings,
Sort: sortStrings,
Facets: []string{
"cspName",
"cspRegion",
Expand Down
3 changes: 0 additions & 3 deletions internal/data_sources/transport_product_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,6 @@ func (d *transportProductDataSource) Read(ctx context.Context, req datasource.Re
resp.Diagnostics.AddError("error getting filters", err.Error())
}
sortStrings := getSortString(data.Sort)
if err != nil {
resp.Diagnostics.AddError("error getting sort", err.Error())
}

// Define the search request
searchRequest := &meilisearch.SearchRequest{
Expand Down

0 comments on commit 152336c

Please sign in to comment.