Remove unused contexts

This commit is contained in:
Liam 2024-07-16 18:44:01 -04:00
parent 43bde0e72c
commit d91667d70a
4 changed files with 0 additions and 245 deletions

View file

@ -1,104 +0,0 @@
defmodule Philomena.UserWhitelists do
@moduledoc """
The UserWhitelists context.
"""
import Ecto.Query, warn: false
alias Philomena.Repo
alias Philomena.UserWhitelists.UserWhitelist
@doc """
Returns the list of user_whitelists.
## Examples
iex> list_user_whitelists()
[%UserWhitelist{}, ...]
"""
def list_user_whitelists do
Repo.all(UserWhitelist)
end
@doc """
Gets a single user_whitelist.
Raises `Ecto.NoResultsError` if the User whitelist does not exist.
## Examples
iex> get_user_whitelist!(123)
%UserWhitelist{}
iex> get_user_whitelist!(456)
** (Ecto.NoResultsError)
"""
def get_user_whitelist!(id), do: Repo.get!(UserWhitelist, id)
@doc """
Creates a user_whitelist.
## Examples
iex> create_user_whitelist(%{field: value})
{:ok, %UserWhitelist{}}
iex> create_user_whitelist(%{field: bad_value})
{:error, %Ecto.Changeset{}}
"""
def create_user_whitelist(attrs \\ %{}) do
%UserWhitelist{}
|> UserWhitelist.changeset(attrs)
|> Repo.insert()
end
@doc """
Updates a user_whitelist.
## Examples
iex> update_user_whitelist(user_whitelist, %{field: new_value})
{:ok, %UserWhitelist{}}
iex> update_user_whitelist(user_whitelist, %{field: bad_value})
{:error, %Ecto.Changeset{}}
"""
def update_user_whitelist(%UserWhitelist{} = user_whitelist, attrs) do
user_whitelist
|> UserWhitelist.changeset(attrs)
|> Repo.update()
end
@doc """
Deletes a UserWhitelist.
## Examples
iex> delete_user_whitelist(user_whitelist)
{:ok, %UserWhitelist{}}
iex> delete_user_whitelist(user_whitelist)
{:error, %Ecto.Changeset{}}
"""
def delete_user_whitelist(%UserWhitelist{} = user_whitelist) do
Repo.delete(user_whitelist)
end
@doc """
Returns an `%Ecto.Changeset{}` for tracking user_whitelist changes.
## Examples
iex> change_user_whitelist(user_whitelist)
%Ecto.Changeset{source: %UserWhitelist{}}
"""
def change_user_whitelist(%UserWhitelist{} = user_whitelist) do
UserWhitelist.changeset(user_whitelist, %{})
end
end

View file

@ -1,20 +0,0 @@
defmodule Philomena.UserWhitelists.UserWhitelist do
use Ecto.Schema
import Ecto.Changeset
alias Philomena.Users.User
schema "user_whitelists" do
belongs_to :user, User
field :reason, :string
timestamps(inserted_at: :created_at, type: :utc_datetime)
end
@doc false
def changeset(user_whitelist, attrs) do
user_whitelist
|> cast(attrs, [])
|> validate_required([])
end
end

View file

@ -1,104 +0,0 @@
defmodule Philomena.Vpns do
@moduledoc """
The Vpns context.
"""
import Ecto.Query, warn: false
alias Philomena.Repo
alias Philomena.Vpns.Vpn
@doc """
Returns the list of vpns.
## Examples
iex> list_vpns()
[%Vpn{}, ...]
"""
def list_vpns do
Repo.all(Vpn)
end
@doc """
Gets a single vpn.
Raises `Ecto.NoResultsError` if the Vpn does not exist.
## Examples
iex> get_vpn!(123)
%Vpn{}
iex> get_vpn!(456)
** (Ecto.NoResultsError)
"""
def get_vpn!(id), do: Repo.get!(Vpn, id)
@doc """
Creates a vpn.
## Examples
iex> create_vpn(%{field: value})
{:ok, %Vpn{}}
iex> create_vpn(%{field: bad_value})
{:error, %Ecto.Changeset{}}
"""
def create_vpn(attrs \\ %{}) do
%Vpn{}
|> Vpn.changeset(attrs)
|> Repo.insert()
end
@doc """
Updates a vpn.
## Examples
iex> update_vpn(vpn, %{field: new_value})
{:ok, %Vpn{}}
iex> update_vpn(vpn, %{field: bad_value})
{:error, %Ecto.Changeset{}}
"""
def update_vpn(%Vpn{} = vpn, attrs) do
vpn
|> Vpn.changeset(attrs)
|> Repo.update()
end
@doc """
Deletes a Vpn.
## Examples
iex> delete_vpn(vpn)
{:ok, %Vpn{}}
iex> delete_vpn(vpn)
{:error, %Ecto.Changeset{}}
"""
def delete_vpn(%Vpn{} = vpn) do
Repo.delete(vpn)
end
@doc """
Returns an `%Ecto.Changeset{}` for tracking vpn changes.
## Examples
iex> change_vpn(vpn)
%Ecto.Changeset{source: %Vpn{}}
"""
def change_vpn(%Vpn{} = vpn) do
Vpn.changeset(vpn, %{})
end
end

View file

@ -1,17 +0,0 @@
defmodule Philomena.Vpns.Vpn do
use Ecto.Schema
import Ecto.Changeset
@primary_key false
schema "vpns" do
field :ip, EctoNetwork.INET
end
@doc false
def changeset(vpn, attrs) do
vpn
|> cast(attrs, [])
|> validate_required([])
end
end