valeriaMolina / polish-finder-dot-com

Helps you find a nail polish dupe!
1 stars 0 forks source link

Implement 'like' or 'heart' functionality for a nail polish #46

Open valeriaMolina opened 1 month ago

valeriaMolina commented 1 month ago
  1. Design a likes table: CREATE TABLE likes ( like_id SERIAL PRIMARY KEY, user_id INT REFERENCES users(user_id), brand_id INT REFERENCES brands(brand_id), created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, UNIQUE (user_id, brand_id) -- Ensures a user can only like a brand once );

  2. API ENDPOINTS: Like a brand Unlike a brand Get the count of likes for a brand Get the brands liked by a user

  3. Frontend Implementation: Like Button: A button or icon on the brand page to like/unlike the brand. Display Like Count: Show the number of likes a brand has received. User's Liked Brands: A section in the user's profile to display the brands they have liked.