Forage.Codec.Encoder (forage v0.4.0)

Functionality to encode a Forage.Plan into a Phoenix param map for use with the ApplicationWeb.Router.Helpers.

Link to this section Summary

Functions

Encodes a forage plan into a params map.

Encode the "filter" part of a forage plan. Returns a map.

Encode the "pagination" part of a forage plan. Returns a map.

Encode the "sort" part of a forage plan. Returns a map.

Link to this section Functions

Encodes a forage plan into a params map.

This function doesn't need to take the schema as an argument because it will never have to convert a string into an atom (the params map contains only strings and never atoms)

Link to this function

encode_filter(plan)

Encode the "filter" part of a forage plan. Returns a map.

Link to this function

encode_pagination(plan)

Encode the "pagination" part of a forage plan. Returns a map.

Link to this function

encode_sort(plan)

Encode the "sort" part of a forage plan. Returns a map.