Skip to content

Commit 5b801d3

Browse files
committed
fix API validation breaking POST /escape/products endpoint
1 parent 93ab40f commit 5b801d3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

app/api/v2/escape/menu/products/route.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,16 @@ export async function PATCH(
3636
export async function POST(
3737
req: NextRequest
3838
) {
39+
const product: MenuProductCreate = await req.json();
40+
3941
const session = await getServerSession(authOptions);
40-
const authCheck = new Auth(session)
42+
const authCheck = new Auth(session, product)
4143
.requireRoles([])
4244
.requireParams(["name", "hidden", "price", "volume", "glutenfree", "category_id", "priceVolunteer"]);
4345

4446
if (authCheck.failed) return authCheck.response;
4547

4648

47-
const product: MenuProductCreate = await req.json();
4849

4950
await prisma.menuProduct.create({
5051
data: product

0 commit comments

Comments
 (0)