mirror of
https://github.com/philomena-dev/philomena.git
synced 2025-01-20 06:37:59 +01:00
count correctly
This commit is contained in:
parent
482f1dfe5e
commit
b62a723efe
2 changed files with 1 additions and 2 deletions
|
@ -209,7 +209,7 @@ defmodule Philomena.Tags do
|
|||
new_count =
|
||||
Image
|
||||
|> join(:inner, [i], _ in assoc(i, :tags))
|
||||
|> where([_i, t], t.id == ^target_tag.id)
|
||||
|> where([i, t], i.hidden_from_users == true and t.id == ^target_tag.id)
|
||||
|> Repo.aggregate(:count, :id)
|
||||
|
||||
Tag
|
||||
|
|
|
@ -3,7 +3,6 @@ defmodule PhilomenaWeb.Tag.ImageController do
|
|||
|
||||
alias Philomena.Tags.Tag
|
||||
alias Philomena.Tags
|
||||
import Ecto.Query
|
||||
|
||||
plug PhilomenaWeb.CanaryMapPlug, update: :edit, delete: :edit
|
||||
plug :load_and_authorize_resource, model: Tag, id_name: "tag_id", id_field: "slug", preload: [:implied_tags], persisted: true
|
||||
|
|
Loading…
Reference in a new issue