mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-08-25 04:26:00 -05:00
freeAgentMatches bug fix
This commit is contained in:
@@ -126,14 +126,18 @@ const resolvers = {
|
||||
const post = await FAPost.findOne({ discord_id: ctx.user.discord_id })
|
||||
|
||||
if (!post) {
|
||||
return { matched_discord_ids: [], number_of_likes_received: 0 }
|
||||
return {
|
||||
matched_discord_users: [],
|
||||
number_of_likes_received: 0,
|
||||
liked_discord_ids: [],
|
||||
}
|
||||
}
|
||||
|
||||
const likesGiven = await FALike.find({
|
||||
let likesGiven = await FALike.find({
|
||||
liker_discord_id: ctx.user.discord_id,
|
||||
}).populate("liked_discord_user")
|
||||
|
||||
const likesReceived = await FALike.find({
|
||||
let likesReceived = await FALike.find({
|
||||
liked_discord_id: ctx.user.discord_id,
|
||||
})
|
||||
|
||||
@@ -149,6 +153,8 @@ const resolvers = {
|
||||
return [...acc, cur.liked_discord_user]
|
||||
}, [])
|
||||
|
||||
console.log("matched_discord_users", matched_discord_users)
|
||||
|
||||
return {
|
||||
matched_discord_users,
|
||||
number_of_likes_received,
|
||||
|
||||
Reference in New Issue
Block a user