Skip to content

Commit

Permalink
Refactor POST function in listings route to fix typo in parameter name
Browse files Browse the repository at this point in the history
  • Loading branch information
GithmiHashara committed Sep 13, 2024
1 parent 19c668d commit 9970477
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/api/listings/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import { NextResponse } from 'next/server'
import prisma from '@/app/libs/prismadb'
import getCurrentUser from '@/app/actions/getCurrentUser'

export async function POST(reqest: Request) {
export async function POST(request: Request) {
const currentUser = await getCurrentUser()

if (!currentUser) {
return NextResponse.error()
}

const body = await reqest.json()
const body = await request.json()
const { title, description, imageSrc, category, roomCount, guestCount, bathroomCount, location, price } = body

const listing = await prisma.listing.create({
Expand Down

0 comments on commit 9970477

Please sign in to comment.