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