mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
Revert "Try to filter only for events with location"
This reverts commit f247e6bd7b7554442493b799780186b916890043.
This commit is contained in:
parent
a427b21948
commit
737a8f4380
@ -1,6 +1,6 @@
|
||||
import { v4 as uuid } from 'uuid'
|
||||
import { neo4jgraphql } from 'neo4j-graphql-js'
|
||||
import { isEmpty, cloneDeep } from 'lodash'
|
||||
import { isEmpty } from 'lodash'
|
||||
import { UserInputError } from 'apollo-server'
|
||||
import { mergeImage, deleteImage } from './images/images'
|
||||
import Resolver from './helpers/Resolver'
|
||||
@ -12,15 +12,12 @@ import { createOrUpdateLocations } from './users/location'
|
||||
import CONFIG from '../../config'
|
||||
|
||||
const maintainPinnedPosts = (params) => {
|
||||
const filter = cloneDeep(params.filter)
|
||||
const pinnedPostFilter = { pinned: true }
|
||||
if (isEmpty(params.filter)) {
|
||||
params.filter = { OR: [pinnedPostFilter, {}] }
|
||||
} else {
|
||||
console.log('maintainPinnedPosts before: ', {...filter})
|
||||
params.filter = { OR: [pinnedPostFilter, { ...filter }] }
|
||||
params.filter = { OR: [pinnedPostFilter, { ...params.filter }] }
|
||||
}
|
||||
console.log('maintainPinnedPosts after: ', {...filter})
|
||||
return params
|
||||
}
|
||||
|
||||
@ -41,8 +38,6 @@ export default {
|
||||
params = await filterForMutedUsers(params, context)
|
||||
params = filterEventDates(params)
|
||||
params = await maintainPinnedPosts(params)
|
||||
console.log('maintainPinnedPosts filter.OR[1].eventLocation: ', params.filter.OR[1].eventLocation)
|
||||
console.log('maintainPinnedPosts filter: ', params.filter)
|
||||
return neo4jgraphql(object, params, context, resolveInfo)
|
||||
},
|
||||
profilePagePosts: async (object, params, context, resolveInfo) => {
|
||||
|
||||
@ -1,10 +1,3 @@
|
||||
input _LocationFilter {
|
||||
NOT: _LocationFilter
|
||||
id: ID
|
||||
id_not: ID
|
||||
name: String
|
||||
}
|
||||
|
||||
type Location {
|
||||
id: ID!
|
||||
name: String!
|
||||
@ -32,3 +25,4 @@ type LocationMapBox {
|
||||
type Query {
|
||||
queryLocations(place: String!, lang: String!): [LocationMapBox]!
|
||||
}
|
||||
|
||||
|
||||
@ -84,10 +84,8 @@ input _PostFilter {
|
||||
group: _GroupFilter
|
||||
postsInMyGroups: Boolean
|
||||
postType_in: [PostType]
|
||||
eventLocation_not: _LocationFilter
|
||||
eventLocation: _LocationFilter
|
||||
eventStart_gte: String
|
||||
eventEnd_gte: String
|
||||
eventStart_gte: String
|
||||
eventEnd_gte: String
|
||||
}
|
||||
|
||||
enum _PostOrdering {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user