StrawHat.Map v0.3.0 StrawHat.Map.State View Source
Defines functionality for states management.
Link to this section Summary
Functions
Create a state
Destroy a state
Get a state by id
Get list of cities
Get list of counties
Get a state by id
Get the list of states
Get list of states
Update a state
Link to this section Functions
Link to this function
create_state(state_attrs)
View Source
create_state(StrawHat.Map.Schema.State.state_attrs()) :: {:ok, StrawHat.Map.Schema.State.t()} | {:error, Ecto.Changeset.t()}
Create a state.
Link to this function
destroy_state(state)
View Source
destroy_state(StrawHat.Map.Schema.State.t()) :: {:ok, StrawHat.Map.Schema.State.t()} | {:error, Ecto.Changeset.t()}
Destroy a state.
Link to this function
find_state(state_id)
View Source
find_state(String.t()) :: {:ok, StrawHat.Map.Schema.State.t()} | {:error, StrawHat.Error.t()}
Get a state by id
.
Link to this function
get_cities(state)
View Source
get_cities(StrawHat.Map.Schema.State.t()) :: [StrawHat.Map.Schema.City.t()] | no_return()
get_cities([integer()]) :: [StrawHat.Map.Schema.City.t()] | no_return()
Get list of cities.
Link to this function
get_counties(state_ids)
View Source
get_counties([integer()]) :: [StrawHat.Map.Schema.County.t()] | no_return()
Get list of counties.
Link to this function
get_state(state_id)
View Source
get_state(String.t()) :: StrawHat.Map.Schema.State.t() | nil | no_return()
Get a state by id
.
Link to this function
get_states(pagination \\ [])
View Source
get_states(Scrivener.Config.t()) :: Scrivener.Page.t()
Get the list of states.
Link to this function
get_states_by_ids(state_ids)
View Source
get_states_by_ids([integer()]) :: [StrawHat.Map.Schema.State.t()] | no_return()
Get list of states.
Link to this function
update_state(state, state_attrs)
View Source
update_state( StrawHat.Map.Schema.State.t(), StrawHat.Map.Schema.State.state_attrs() ) :: {:ok, StrawHat.Map.Schema.State.t()} | {:error, Ecto.Changeset.t()}
Update a state.