Forage.Codec.Decoder (forage v0.8.0)
Functionality to decode a Phoenix params map into a form suitable for use
with the query builders and pagination libraries
Link to this section Summary
Functions
Encodes a params map into a forage plan (Forage.ForagerPlan).
Extract and decode the filter filters from the params map into a list of filters.
Extract and decode the pagination data from the params map into a keyword list.
Extract and decode the sort fields from the params map into a keyword list.
To be used without a schema.
Extract and decode the sort fields from the params map into a keyword list.
To be used with a schema.
Link to this section Types
assoc()
schema()
@type schema() :: atom()
Link to this section Functions
decode(params, schema)
Encodes a params map into a forage plan (Forage.ForagerPlan).
decode_field_or_assoc(field_string, schema)
decode_filter(arg1, schema)
Extract and decode the filter filters from the params map into a list of filters.
examples
Examples:
TODO
decode_pagination(arg1, schema)
Extract and decode the pagination data from the params map into a keyword list.
decode_sort(arg1)
Extract and decode the sort fields from the params map into a keyword list.
To be used without a schema.
decode_sort(arg1, schema)
Extract and decode the sort fields from the params map into a keyword list.
To be used with a schema.