Skip to content

Commit

Permalink
fix: build error.
Browse files Browse the repository at this point in the history
  • Loading branch information
dewodt committed Feb 24, 2024
1 parent d2ac7a3 commit 526689c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions app/api/feedback/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { authOptions } from "@/lib/auth-options";
import { appendGoogleSheets } from "@/lib/google-sheets";
import PostHogClient from "@/lib/posthog-server";
import { prisma } from "@/lib/prisma";
import { isUserAllowedFeedback, isUserFeedbacked } from "@/lib/query";
import { getUserTicket, isUserFeedbacked } from "@/lib/query";
import { feedbackEndDate, feedbackStartDate } from "@/lib/special-date";
import { feedbackSchema } from "@/lib/zod";
import { getServerSession } from "next-auth";
Expand Down Expand Up @@ -35,10 +35,11 @@ export const POST = async (req: NextRequest) => {
// }

// Check if feedbacked
const [check1, check2] = await Promise.all([
const [check1, ticketId] = await Promise.all([
isUserFeedbacked(session.id),
isUserAllowedFeedback(session.id),
getUserTicket(session.id),
]);
const isHaveTicket = ticketId !== null;

if (check1) {
return NextResponse.json(
Expand All @@ -48,7 +49,7 @@ export const POST = async (req: NextRequest) => {
}

// Check if user passed to main event
if (!check2) {
if (!isHaveTicket) {
return NextResponse.json(
{
error: "Bad Request",
Expand Down

0 comments on commit 526689c

Please sign in to comment.