diff --git a/app/graph/types/team_type.rb b/app/graph/types/team_type.rb index 70e21b8c7..2d91c95ea 100644 --- a/app/graph/types/team_type.rb +++ b/app/graph/types/team_type.rb @@ -316,6 +316,7 @@ def tipline_requests(from_timestamp:, to_timestamp:) argument :tags, [GraphQL::Types::String, null: true], required: false, camelize: false argument :language, [GraphQL::Types::String, null: true], required: false, camelize: false argument :updated_at, GraphQL::Types::String, required: false, camelize: false # JSON + argument :created_at, GraphQL::Types::String, required: false, camelize: false # JSON argument :text, GraphQL::Types::String, required: false, camelize: false # Search by text argument :standalone, GraphQL::Types::Boolean, required: false, camelize: false # Not applied to any item (fact-checks only) argument :publisher_ids, [GraphQL::Types::Int, null: true], required: false, camelize: false @@ -347,6 +348,7 @@ def articles(**args) argument :tags, [GraphQL::Types::String, null: true], required: false, camelize: false argument :language, [GraphQL::Types::String, null: true], required: false, camelize: false argument :updated_at, GraphQL::Types::String, required: false, camelize: false # JSON + argument :created_at, GraphQL::Types::String, required: false, camelize: false # JSON argument :text, GraphQL::Types::String, required: false, camelize: false # Search by text argument :standalone, GraphQL::Types::Boolean, required: false, camelize: false # Not applied to any item (fact-checks only) argument :publisher_ids, [GraphQL::Types::Int, null: true], required: false, camelize: false diff --git a/app/models/team.rb b/app/models/team.rb index 55809ee42..d21a588a2 100644 --- a/app/models/team.rb +++ b/app/models/team.rb @@ -498,6 +498,7 @@ def filtered_explainers(filters = {}) # Filter by date query = query.where(updated_at: Range.new(*format_times_search_range_filter(JSON.parse(filters[:updated_at]), nil))) unless filters[:updated_at].blank? + query = query.where(created_at: Range.new(*format_times_search_range_filter(JSON.parse(filters[:created_at]), nil))) unless filters[:created_at].blank? # Filter by trashed query = query.where(trashed: !!filters[:trashed]) @@ -529,6 +530,7 @@ def filtered_fact_checks(filters = {}) # Filter by date query = query.where('fact_checks.updated_at' => Range.new(*format_times_search_range_filter(JSON.parse(filters[:updated_at]), nil))) unless filters[:updated_at].blank? + query = query.where('fact_checks.created_at' => Range.new(*format_times_search_range_filter(JSON.parse(filters[:created_at]), nil))) unless filters[:created_at].blank? # Filter by publisher query = query.where('fact_checks.publisher_id' => filters[:publisher_ids].to_a.map(&:to_i)) unless filters[:publisher_ids].blank? diff --git a/lib/relay.idl b/lib/relay.idl index 203a4014f..d6e413ac8 100644 --- a/lib/relay.idl +++ b/lib/relay.idl @@ -13187,6 +13187,7 @@ type Team implements Node { Returns the elements in the list that come before the specified cursor. """ before: String + created_at: String """ Returns the first _n_ elements from the list. @@ -13213,7 +13214,7 @@ type Team implements Node { updated_at: String user_ids: [Int] ): ArticleUnionConnection - articles_count(article_type: String, imported: Boolean, language: [String], publisher_ids: [Int], rating: [String], report_status: [String], standalone: Boolean, tags: [String], target_id: Int, text: String, trashed: Boolean = false, updated_at: String, user_ids: [Int]): Int + articles_count(article_type: String, created_at: String, imported: Boolean, language: [String], publisher_ids: [Int], rating: [String], report_status: [String], standalone: Boolean, tags: [String], target_id: Int, text: String, trashed: Boolean = false, updated_at: String, user_ids: [Int]): Int available_newsletter_header_types: JsonStringType avatar: String bot_query(enableLanguageDetection: Boolean, enableLinkShortening: Boolean, maxNumberOfWords: Int, searchText: String!, shouldRestrictByLanguage: Boolean, threshold: Float, utmCode: String): [TiplineSearchResult!] diff --git a/public/relay.json b/public/relay.json index 6476abeec..109379249 100644 --- a/public/relay.json +++ b/public/relay.json @@ -69301,6 +69301,18 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "created_at", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "text", "description": null, @@ -69494,6 +69506,18 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "created_at", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "text", "description": null,