mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-24 04:27:59 +01:00
admin comment and post query fixes
This commit is contained in:
parent
c7c831c901
commit
3874d569b4
2 changed files with 10 additions and 7 deletions
|
@ -60,13 +60,14 @@ defmodule Philomena.Comments.Query do
|
|||
"my" => &Philomena.Comments.Query.user_my_transform/2
|
||||
})
|
||||
|
||||
mod_literal_fields = literal_fields ++ ~W(fingerprint)
|
||||
mod_literal_fields = ~W(image_id user_id author fingerprint)
|
||||
mod_ip_fields = ~W(ip)
|
||||
mod_bool_fields = ~W(anonymous deleted)
|
||||
mod_aliases = Map.merge(aliases, %{
|
||||
"deleted" => "hidden_from_users"
|
||||
})
|
||||
|
||||
mod_custom = user_custom -- ~W(author user_id)
|
||||
mod_transforms = Map.drop(user_transforms, ["user_id", "author"])
|
||||
|
||||
@anonymous_parser Parser.parser(
|
||||
int_fields: int_fields,
|
||||
|
@ -97,8 +98,8 @@ defmodule Philomena.Comments.Query do
|
|||
ip_fields: mod_ip_fields,
|
||||
ngram_fields: ngram_fields,
|
||||
bool_fields: mod_bool_fields,
|
||||
custom_fields: user_custom,
|
||||
transforms: user_transforms,
|
||||
custom_fields: mod_custom,
|
||||
transforms: mod_transforms,
|
||||
aliases: mod_aliases,
|
||||
default_field: default_field
|
||||
)
|
||||
|
|
|
@ -57,12 +57,14 @@ defmodule Philomena.Posts.Query do
|
|||
"my" => &Philomena.Posts.Query.user_my_transform/2
|
||||
})
|
||||
|
||||
mod_literal_fields = literal_fields ++ ~W(fingerprint)
|
||||
mod_literal_fields = ~W(forum_id topic_id user_id author fingerprint)
|
||||
mod_ip_fields = ~W(ip)
|
||||
mod_bool_fields = ~W(anonymous deleted)
|
||||
mod_aliases = %{
|
||||
"deleted" => "hidden_from_users"
|
||||
}
|
||||
mod_custom = user_custom -- ~W(author user_id)
|
||||
mod_transforms = Map.drop(user_transforms, ["user_id", "author"])
|
||||
|
||||
|
||||
@anonymous_parser Parser.parser(
|
||||
|
@ -92,8 +94,8 @@ defmodule Philomena.Posts.Query do
|
|||
ip_fields: mod_ip_fields,
|
||||
ngram_fields: ngram_fields,
|
||||
bool_fields: mod_bool_fields,
|
||||
custom_fields: user_custom,
|
||||
transforms: user_transforms,
|
||||
custom_fields: mod_custom,
|
||||
transforms: mod_transforms,
|
||||
aliases: mod_aliases,
|
||||
default_field: default_field
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue