-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #55 from odeta939/wineInfo
Wine info
- Loading branch information
Showing
24 changed files
with
265 additions
and
196 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,17 @@ | ||
import { createReview } from "@/sanity/sanity-utils/review-utils"; | ||
import { NextResponse } from "next/server"; | ||
import { createReview } from '@/sanity/sanity-utils/review-utils'; | ||
import { getUser } from '@/sanity/sanity-utils/user-utils'; | ||
|
||
export async function POST(req:Request) { | ||
const response : Review = await req.json(); | ||
await createReview(response); | ||
import { NextResponse } from 'next/server'; | ||
|
||
export async function POST(req: Request) { | ||
const response: ReviewDTO = await req.json(); | ||
const user = await getUser(response.userId); | ||
const reviewToPost = { | ||
rating: response.rating, | ||
comment: response.comment, | ||
wineId: response.wineId, | ||
userId: user._id, | ||
}; | ||
await createReview(reviewToPost); | ||
return NextResponse.json({ message: 'ok' }); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import ProfileLogo from '@/lib/assets/ProfileLogo'; | ||
|
||
interface Props { | ||
name: string; | ||
} | ||
|
||
const Avatar = ({ name }: Props) => { | ||
return ( | ||
<div className='flex flex-col items-center pr-4 md:pr-8'> | ||
<div className=' rounded-full'> | ||
<ProfileLogo /> | ||
</div> | ||
<div className='text-xs'> | ||
<p>{name}</p> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Avatar; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import Avatar from './Avatar'; | ||
export default Avatar; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.