mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-06-12 20:21:05 -05:00
using promise all in addFreeAgentPost resolver
This commit is contained in:
parent
1752fb64c7
commit
3eb635bb2e
|
|
@ -143,16 +143,14 @@ const resolvers = {
|
|||
}
|
||||
|
||||
const faPost = new FAPost({ ...args, discord_id: ctx.user.discord_id })
|
||||
await faPost.save().catch(e => {
|
||||
args.user = ctx.user
|
||||
await Promise.all([faPost.save(), sendFAPostToDiscord(args)]).catch(e => {
|
||||
throw (new UserInputError(),
|
||||
{
|
||||
invalidArgs: args,
|
||||
})
|
||||
})
|
||||
|
||||
args.user = ctx.user
|
||||
sendFAPostToDiscord(args)
|
||||
|
||||
return true
|
||||
},
|
||||
updateFreeAgentPost: async (root, args, ctx) => {
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ function sendFAPostToDiscord(args) {
|
|||
)
|
||||
}
|
||||
|
||||
return Hook.send(msg)
|
||||
return () => Hook.send(msg)
|
||||
}
|
||||
|
||||
module.exports = sendFAPostToDiscord
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user