hide opted-out instances from table

This commit is contained in:
Tao Bror Bojlén 2019-08-29 19:04:43 +01:00
parent 1c1ef37df9
commit 19b3a3806d
No known key found for this signature in database
GPG key ID: C6EC7AAB905F9E6F
2 changed files with 2 additions and 2 deletions

View file

@ -9,7 +9,7 @@ defmodule Backend.Api do
@spec get_instances(Integer.t() | nil) :: Scrivener.Page.t() @spec get_instances(Integer.t() | nil) :: Scrivener.Page.t()
def get_instances(page \\ nil) do def get_instances(page \\ nil) do
Instance Instance
|> where([i], not is_nil(i.type)) |> where([i], not is_nil(i.type) and not i.opt_out)
|> Repo.paginate(page: page) |> Repo.paginate(page: page)
end end

View file

@ -78,7 +78,7 @@ class InstanceTable extends React.PureComponent<IInstanceTableProps> {
<PaginationContainer> <PaginationContainer>
<p> <p>
Showing {(currentPage - 1) * pageSize + 1}-{Math.min(currentPage * pageSize, totalEntries)} of{" "} Showing {(currentPage - 1) * pageSize + 1}-{Math.min(currentPage * pageSize, totalEntries)} of{" "}
{totalEntries} known instances {totalEntries} known active instances
</p> </p>
<ButtonGroup> <ButtonGroup>