Skip to content

Refactor Login UI#12

Merged
Maikiw7 merged 2 commits intoDevelopmentfrom
feature/Polls
Feb 25, 2025
Merged

Refactor Login UI#12
Maikiw7 merged 2 commits intoDevelopmentfrom
feature/Polls

Conversation

@LordEaster
Copy link
Copy Markdown
Member

This pull request includes significant changes to the database schema, seed data, and backend services to enhance poll functionality. The most important changes include adding new fields to the Poll model, restructuring database relationships, updating seed data generation, and expanding the poll controller with new endpoints.

Database Schema Changes:

  • Added canEdit field to the Poll model and removed pollId from the Guest table. (backend/prisma/migrations/20250219021609_/migration.sql, backend/prisma/schema.prisma) [1] [2] [3]
  • Modified unique constraints and foreign key relationships for WhitelistUser, Guest, and VoteRestriction models. (backend/prisma/schema.prisma) [1] [2] [3]

Seed Data Updates:

  • Refactored seed script to create users, events, polls, options, whitelist users, guests, votes, and vote restrictions with randomized data. (backend/prisma/seeds/seed.ts)

Backend Service Enhancements:

  • Added new methods myPolls, publicPolls, and myVotedPolls to the PollController to fetch user-specific and public poll data. (backend/src/controllers/poll.controller.ts) [1] [2] [3]
  • Updated AuthMiddleware to correctly handle guest user tokens using decode.sub. (backend/src/middlewares/auth.middleware.ts) [1] [2]

Route Adjustments:

  • Added new routes for fetching user-specific and public polls with appropriate authentication middleware. (backend/src/routes/poll.routes.ts) [1] [2]

@LordEaster LordEaster requested a review from boytur February 24, 2025 16:06
@LordEaster LordEaster changed the base branch from main to Development February 24, 2025 16:09
@Maikiw7 Maikiw7 merged commit 2db2fd3 into Development Feb 25, 2025
@boytur boytur deleted the feature/Polls branch February 25, 2025 14:49
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.

2 participants