mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-06-02 22:26:57 -05:00
vouches can't see suggestions/vouches
This commit is contained in:
parent
079d0bf4e4
commit
7a01b43bec
|
|
@ -78,6 +78,7 @@ const Suggestions = ({
|
|||
if (loading || vouchesLoading) return <Loading minHeight="250px" />
|
||||
if (error) return <Error errorMessage={error.message} />
|
||||
if (vouchesError) return <Error errorMessage={vouchesError.message} />
|
||||
if (!data.suggestions) return null
|
||||
|
||||
const ownSuggestion = data.suggestions.find(
|
||||
suggestion =>
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ const typeDef = gql`
|
|||
extend type Query {
|
||||
plusInfo: PlusGeneralInfo
|
||||
hasAccess(discord_id: String!, server: String!): Boolean!
|
||||
suggestions: [Suggested!]!
|
||||
suggestions: [Suggested!]
|
||||
vouches: [User!]
|
||||
usersForVoting: UsersForVoting!
|
||||
summaries: [Summary!]
|
||||
|
|
@ -275,7 +275,8 @@ const resolvers = {
|
|||
return { users, suggested, votes }
|
||||
},
|
||||
suggestions: (root, args, ctx) => {
|
||||
if (!ctx.user || !ctx.user.plus) return null
|
||||
if (!ctx.user || !ctx.user.plus || !ctx.user.plus.membership_status)
|
||||
return null
|
||||
const searchCriteria =
|
||||
ctx.user.plus.membership_status === "ONE" ? {} : { plus_server: "TWO" }
|
||||
return Suggested.find(searchCriteria)
|
||||
|
|
@ -289,7 +290,7 @@ const resolvers = {
|
|||
})
|
||||
},
|
||||
vouches: (root, args, { user }) => {
|
||||
if (!user || !user.plus) return null
|
||||
if (!user || !user.plus || !user.plus.membership_status) return null
|
||||
const searchCriteria =
|
||||
user.plus.membership_status === "ONE"
|
||||
? { "plus.vouch_status": { $ne: null } }
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user