Forage.Codec.Decoder (forage v0.5.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

Specs

assoc() :: {schema(), atom(), atom()}

Specs

schema() :: atom()

Link to this section Functions

Link to this function

decode(params, schema)

Encodes a params map into a forage plan (Forage.ForagerPlan).

Link to this function

decode_field_or_assoc(field_string, schema)

Link to this function

decode_filter(arg1, schema)

Extract and decode the filter filters from the params map into a list of filters.

Examples:

TODO

Link to this function

decode_pagination(arg1, schema)

Extract and decode the pagination data from the params map into a keyword list.

Link to this function

decode_sort(arg1)

Extract and decode the sort fields from the params map into a keyword list. To be used without a schema.

Link to this function

decode_sort(arg1, schema)

Extract and decode the sort fields from the params map into a keyword list. To be used with a schema.

Link to this function

pagination_data_to_integer!(value)