billychen0894 / florist-ecommerce-app

Florist eCommerce App built with Next.js 14
https://florist-ecommerce-app.vercel.app
0 stars 0 forks source link

Refactoring/Enhancement: Store Individual Product Page #82

Open billychen0894 opened 5 months ago

billychen0894 commented 5 months ago

Overview

Implementation Checklist

Disclaimer

This issue is used for tracking purposes and to document the progress and improvements made to the project. It will remain open to allow easy access and visibility of the ongoing enhancements/refactoring efforts. Comments in this issue will be updated regularly to reflect progress and any additional improvements.

billychen0894 commented 5 months ago

Task 1: Refactor product fetch call

Instead of creating an api route to get product information from db, a server action of getProductById is created to get product info directly from db without exposing server code to client-side.

Related commits

billychen0894 commented 4 months ago

Task 2: Refactor ProductActions component

In most pages related to products, they are first server-side rendering as the data of products don't change often and does not require client-side interactions. After that, any further user actions that triggers data change such as filters or sorting, it will then be client-side rendering.

Related commits