mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
Investigate the graph-ql middleware
This commit is contained in:
parent
02095274c7
commit
f20643af3b
@ -76,5 +76,10 @@ export default {
|
||||
AddEmailAddress: sendEmailVerificationMail,
|
||||
requestPasswordReset: sendPasswordResetMail,
|
||||
Signup: sendSignupMail,
|
||||
// Wolle
|
||||
// CreatePost: handleContentDataOfPost,
|
||||
// UpdatePost: handleContentDataOfPost,
|
||||
// CreateComment: handleContentDataOfComment,
|
||||
// UpdateComment: handleContentDataOfComment,
|
||||
},
|
||||
}
|
||||
|
||||
@ -6,11 +6,16 @@ const publishNotifications = async (...promises) => {
|
||||
const notifications = await Promise.all(promises)
|
||||
notifications
|
||||
.flat()
|
||||
.forEach((notificationAdded) => pubsub.publish(NOTIFICATION_ADDED, { notificationAdded }))
|
||||
.forEach((notificationAdded) => {
|
||||
pubsub.publish(NOTIFICATION_ADDED, { notificationAdded })
|
||||
// Wolle
|
||||
// XXX send e-mails
|
||||
})
|
||||
}
|
||||
|
||||
const handleContentDataOfPost = async (resolve, root, args, context, resolveInfo) => {
|
||||
const idsOfUsers = extractMentionedUsers(args.content)
|
||||
// Wolle console.log(context)
|
||||
const post = await resolve(root, args, context, resolveInfo)
|
||||
if (post) {
|
||||
await publishNotifications(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user