backend plus maplists route

This commit is contained in:
Sendou
2020-03-16 12:21:53 +02:00
parent 9007ac5b14
commit fd5ce6bd11

View File

@@ -10,6 +10,7 @@ const maps = require("../utils/maps")
const typeDef = gql`
extend type Query {
maplists: [Maplist!]!
plusMaplists: [Maplist!]!
mapVotes: [MapVote!]
}
@@ -70,6 +71,9 @@ const resolvers = {
})
})
},
plusMaplists: (root, args) => {
return Maplist.find({ plus: { $ne: null } })
},
mapVotes: async (root, args, ctx) => {
if (!ctx.user || !ctx.user.plus || !ctx.user.plus.membership_status) {
return null