Skip to content

Add Post category field to schema — referenced in forms but missing from model #204

@3m1n3nc3

Description

@3m1n3nc3

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions