Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add polls backend #4069

Merged
merged 3 commits into from Nov 26, 2023
Merged

feat: add polls backend #4069

merged 3 commits into from Nov 26, 2023

Conversation

bigint
Copy link
Member

@bigint bigint commented Nov 26, 2023

  • feat: add polls backend
  • fix: responses count
  • fix: responses count

What does this PR do?

πŸ€–[deprecated] Generated by Copilot at 7cd2c79

This pull request adds the backend functionality for the polls feature to the API app of the hey project. It modifies the schema.prisma file to define the data models and the enum type for the polls. It also adds the migration file migration.sql to create the database tables and indexes for the polls. It implements the handlers for the /api/poll/act, /api/poll/create, and /api/poll/get endpoints in the act.ts, create.ts, and get.ts files respectively, using the Prisma client to interact with the database.

Related issues

Fixes # (issue)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Enhancement (non-breaking small changes to existing functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Explanation of the changes

πŸ€–[deprecated] Generated by Copilot at 7cd2c79

  • Add the models, tables, and indexes for the polls feature (link, link)
  • Add the handler for creating a poll with options and length (link)
  • Add the handler for getting a poll with options and responses (link)
  • Add the handler for responding to a poll with option id (link)
  • Format the code in the schema.prisma file (link)
  • Add an enum type for staff pick type in the schema.prisma file (link)

Emoji

πŸ—³οΈπŸ“πŸ“Š

@vercel vercel bot temporarily deployed to Preview – prerender November 26, 2023 10:37 Inactive
Copy link

height bot commented Nov 26, 2023

Link Height tasks by mentioning a task ID in the pull request title or commit messages, or description and comments with the keyword link (e.g. "Link T-123").

πŸ’‘Tip: You can also use "Close T-X" to automatically close a task when the pull request is merged.

Copy link

vercel bot commented Nov 26, 2023

The latest updates on your projects. Learn more about Vercel for Git β†—οΈŽ

Name Status Preview Updated (UTC)
api βœ… Ready (Inspect) Visit Preview Nov 26, 2023 10:38am
prerender βœ… Ready (Inspect) Visit Preview Nov 26, 2023 10:38am
web πŸ”„ Building (Inspect) Visit Preview Nov 26, 2023 10:38am

@vercel vercel bot temporarily deployed to Preview – api November 26, 2023 10:38 Inactive
@bigint bigint merged commit 07a06e3 into main Nov 26, 2023
9 of 10 checks passed
@bigint bigint deleted the polls branch November 26, 2023 10:39
.json({ success: false, error: Errors.InvalidAccesstoken });
}

const { options, length } = body as ExtensionRequest;

Check failure

Code scanning / CodeQL

Type confusion through parameter tampering Critical

Potential type confusion as
this HTTP request parameter
may be either an array or a string.
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.

None yet

1 participant