View Source FatEcto.FatQuery.SortableHelper (FatEcto v1.0.0)

Provides helper functions for sorting query parameters.

Summary

Functions

Filters sortable fields based on the provided sortable_fields map.

Functions

filter_sortable_fields(filtered_params, sortable_fields)

@spec filter_sortable_fields(map(), map()) :: map()

Filters sortable fields based on the provided sortable_fields map.

Parameters

  • filtered_params: A map of fields and their sorting operators.
  • sortable_fields: A map of allowed fields and their corresponding operators.

Returns

  • A filtered map containing only the fields and operators that are allowed.