Description
The CreateGiveawayModal form contains a category/type selector with values like "electronics", "clothing", etc. The validation.ts file has a validateCategory function. However, the Post model in schema.prisma has no category field. The API POST /api/posts does not accept or store a category. Category information entered by users is silently discarded.
More info
- Add
category String? @db.VarChar(100) to the Post model.
- Generate and apply a migration.
- Update
POST /api/posts to accept and store category.
- Update
GET /api/posts to support ?category=electronics filtering.
- Predefined categories should be stored as an enum or a
Category lookup table to ensure consistency.