mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
active categories is array of string (ids of categories), current user query resolves with active categories
This commit is contained in:
parent
d05919fddb
commit
18e15be24d
@ -20,8 +20,9 @@ export default {
|
||||
const result = await transaction.run(
|
||||
`
|
||||
MATCH (user:User {id: $id})
|
||||
WITH user, [(user)<-[:OWNED_BY]-(medium:SocialMedia) | properties(medium) ] as media
|
||||
RETURN user {.*, socialMedia: media } as user
|
||||
MATCH (category:Category) WHERE NOT ((user)-[:NOT_INTERESTED_IN]->(category))
|
||||
WITH user, [(user)<-[:OWNED_BY]-(medium:SocialMedia) | properties(medium) ] as media, category
|
||||
RETURN user {.*, socialMedia: media, activeCategories: collect(category.id) } as user
|
||||
`,
|
||||
{ id: user.id },
|
||||
)
|
||||
|
||||
@ -115,11 +115,11 @@ type User {
|
||||
|
||||
emotions: [EMOTED]
|
||||
|
||||
activeCategories: [Category] @cypher(
|
||||
activeCategories: [String] @cypher(
|
||||
statement: """
|
||||
MATCH (category:Category)
|
||||
WHERE NOT ((this)-[:NOT_INTERESTED_IN]->(category))
|
||||
RETURN category
|
||||
RETURN collect(category.id)
|
||||
"""
|
||||
)
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user