Rachael peng/neu 48 individual page for each headset#18
Rachael peng/neu 48 individual page for each headset#18rachael-peng wants to merge 3 commits intomainfrom
Conversation
| @@ -0,0 +1,65 @@ | |||
| import { db } from '@/app/server/db/index' | |||
There was a problem hiding this comment.
Client side sites should start with "use client".
| @@ -0,0 +1,65 @@ | |||
| import { db } from '@/app/server/db/index' | |||
| import { type Headset, headsets } from '@/app/server/db/schema/headsets' | |||
| import { eq, SQLWrapper } from 'drizzle-orm' | |||
There was a problem hiding this comment.
Database should not be accessed directly from Client. This should make use of existing backend server routes
priyanshumahey
left a comment
There was a problem hiding this comment.
Client and Server need to be decoupled. Current code has server functions (calls to the database) present directly within the client side view. If a prior backend route exists, please use that instead. Otherwise, create a new route specifically for querying up one headset specifically. For the page please use use client to declare it for client side usage.
For further reference, use: https://nextjs.org/docs/app/building-your-application/rendering/client-components. Tldr, splitting client and server improves performance, has better user experience and is more scalable.
| import { type Headset, headsets } from '@/app/server/db/schema/headsets' | ||
| import { eq, SQLWrapper } from 'drizzle-orm' | ||
|
|
||
| /** |
There was a problem hiding this comment.
Server side function present in client
Changes Being Made
Purpose of Change: dynamic page routing for all headsets in database
Here give examples of the changes you've made in this pull request. Include an itemized list if you can.
Screenshots (optional)