PhoenixKitStaff.Departments (PhoenixKitStaff v0.2.0)

Copy Markdown View Source

CRUD for departments.

Summary

Functions

Returns a changeset for the given department.

Total number of departments.

Inserts a department and broadcasts :department_created.

Deletes a department and broadcasts :department_deleted.

Fetches a department by uuid, or nil if not found.

Fetches a department by uuid. Raises if not found.

Lists departments. Accepts :preload.

Updates a department and broadcasts :department_updated.

Functions

change(dept, attrs \\ %{})

Returns a changeset for the given department.

count()

@spec count() :: non_neg_integer()

Total number of departments.

create(attrs)

Inserts a department and broadcasts :department_created.

delete(dept)

Deletes a department and broadcasts :department_deleted.

get(uuid, opts \\ [])

Fetches a department by uuid, or nil if not found.

get!(uuid, opts \\ [])

Fetches a department by uuid. Raises if not found.

list(opts \\ [])

Lists departments. Accepts :preload.

update(dept, attrs)

Updates a department and broadcasts :department_updated.