-
Notifications
You must be signed in to change notification settings - Fork 1
Rachael peng/neu 48 individual page for each headset #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Rachael peng/neu 48 individual page for each headset #18
Conversation
| @@ -0,0 +1,65 @@ | |||
| import { db } from '@/app/server/db/index' | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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)