suggestion improvements

This commit is contained in:
Sendou 2020-01-03 00:18:40 +02:00
parent 712966929e
commit 0344028f8e
3 changed files with 7 additions and 5 deletions

View File

@ -78,6 +78,9 @@ const PlusPage = () => {
return (
<>
<div style={{ float: "right" }}>
<b>{userData.user.plus.plus_region}</b>
</div>
{!showSuggestionForm && (
<>
{data.plusInfo.plus_one_invite_link && (
@ -95,9 +98,6 @@ const PlusPage = () => {
/>
</>
)}
<div style={{ float: "right" }}>
<b>{userData.user.plus.plus_region}</b>
</div>
{data.plusInfo.plus_two_invite_link && (
<>
<div style={{ marginTop: "1em" }}>

View File

@ -125,7 +125,8 @@ const SuggestionForm = ({
</Form.Field>
<Form.Field>
<b>
You can't edit or delete a suggestion after you have submitted it
You can't edit or delete a suggestion after you have submitted it.
One suggestion per month.
</b>
</Form.Field>
<Form.Field>

View File

@ -96,6 +96,7 @@ const typeDef = gql`
year: Int!
"Average of all scores of the voters for the month 0% to 100%"
score: Float!
new: Boolean!
}
type UsersForVoting {
@ -232,7 +233,7 @@ const resolvers = {
suggestions: (root, args, ctx) => {
if (!ctx.user || !ctx.user.plus) return null
const searchCriteria =
ctx.user.plus.membership_status === "ONE" ? {} : { plus_region: "TWO" }
ctx.user.plus.membership_status === "ONE" ? {} : { plus_server: "TWO" }
return Suggested.find(searchCriteria)
.populate("discord_user")
.populate("suggester_discord_user")