Fix people with already having access causing 400 error in voting

This commit is contained in:
Kalle
2024-02-09 23:40:43 +02:00
parent 2c89ca5bfa
commit b4704c1c4a
3 changed files with 28 additions and 6 deletions

View File

@@ -10,7 +10,6 @@ import {
import { COMMON_USER_FIELDS } from "~/utils/kysely.server";
import type { Unwrapped } from "~/utils/types";
import * as PlusSuggestionRepository from "~/features/plus-suggestions/PlusSuggestionRepository.server";
import invariant from "tiny-invariant";
const resultsByMonthYearQuery = (args: MonthYear) =>
db
@@ -89,7 +88,6 @@ export async function usersForVoting(loggedInUser: {
rangeToMonthYear(nextNonCompletedVoting(new Date())),
)
).filter((suggestion) => suggestion.tier === loggedInUser.plusTier);
invariant(suggestedUsers);
const result: UsersForVoting = [];