Skip to content
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

Kevincai/back cart #26

Closed
wants to merge 26 commits into from
Closed

Kevincai/back cart #26

wants to merge 26 commits into from

Conversation

kevinjcai
Copy link
Contributor

@kevinjcai kevinjcai commented Nov 2, 2023

What's new in this PR

Description

Back end cart

Screenshots

How to review

Next steps

Relevant Links

Online sources

Related PRs

🛍 CC: @EthanAuyeung

Copy link

vercel bot commented Nov 2, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
shanti-project ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 9, 2023 0:00am

@kevinjcai
Copy link
Contributor Author

Remove the page.tsx before mergin
Its a test command

Copy link

@surajr10 surajr10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great work on this! lots of clean queries! lmk if you got any questions about anything i wrote. i'd prob also just do a run through to see if all the queries are working again after going through any changes. also make sure to fill out the PR description before merging!

src/api/supabase/queries/user_queries.ts Outdated Show resolved Hide resolved
src/app/page.tsx Outdated Show resolved Hide resolved
src/app/page.tsx Outdated Show resolved Hide resolved
src/app/page.tsx Outdated Show resolved Hide resolved
src/schema/schema.ts Outdated Show resolved Hide resolved
src/api/supabase/queries/user_queries.ts Show resolved Hide resolved
src/api/supabase/queries/user_queries.ts Outdated Show resolved Hide resolved
src/api/supabase/queries/user_queries.ts Outdated Show resolved Hide resolved
src/api/supabase/queries/user_queries.ts Outdated Show resolved Hide resolved
}
}

export async function fetchUserCart(
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'd say for all queries that are rn taking the userId as a parameter, you can remove it. i don't think yall are using an auth/profile context, so i'd say when you're calling these queries from your components, it's probably easier to just omit getting the userId there and passing it to the queries. rather i'd say it'd be easier to just use the supabase.auth.getUser() function (which returns current logged in user which makes sense b/c all of these queries should only be available to person who's logged in at the moment) inside these queries and you can get the userId off of the object returned here.

@EthanAuyeung
Copy link
Collaborator

Refactored

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants