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

chore(prisma): Stream Model #20

Merged
merged 7 commits into from
Dec 21, 2023
Merged

chore(prisma): Stream Model #20

merged 7 commits into from
Dec 21, 2023

Conversation

Zaid-maker
Copy link
Owner

@Zaid-maker Zaid-maker commented Dec 21, 2023


Generated summary (powered by Graphite)

Pull Request Description

TL;DR

This pull request includes changes to a TypeScript file that handles a POST request for a webhook. It verifies the payload, performs different actions based on the event type, and updates the database accordingly. Additionally, it updates the version of "@prisma/client" and makes changes to the prisma schema.

What changed

  • Added a function to handle the POST request for a webhook
  • Added checks for the presence of a webhook secret and required headers
  • Verified the payload using headers and assigned the verified payload to a variable
  • Checked the event type and performed different actions based on the type
  • Modified the conditional statement for the "user.deleted" event type to directly delete a user from the database
  • Updated the version of "@prisma/client" to 5.7.1 in the package.json file
  • Added a new "Stream" field to the "User" model in the prisma schema

How to test

  1. Run the code snippet in a TypeScript environment
  2. Send a POST request to the webhook endpoint with the required headers and payload
  3. Verify that the code handles the request correctly based on the event type
  4. Check that the database is updated accordingly

Why make this change

  • The code now properly handles the verification of the webhook payload and performs the necessary actions based on the event type.
  • The direct deletion of a user from the database simplifies the code and improves efficiency.
  • Updating the version of "@prisma/client" and making changes to the prisma schema ensures compatibility and adds a new field to the "User" model.

Copy link

semanticdiff-com bot commented Dec 21, 2023

Review changes with SemanticDiff.

Analyzed 3 of 4 files.

Overall, the semantic diff is 100% smaller than the GitHub diff.

1 files do not contain logic changes.

Filename Status
✔️ app/api/webhooks/clerk/route.ts No logic changes found
✔️ package-lock.json 62.31% smaller
✔️ package.json Analyzed
prisma/schema.prisma Unsupported file format

Copy link

vercel bot commented Dec 21, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
gamehub ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 21, 2023 3:09pm

Copy link

gitstream-cm bot commented Dec 21, 2023

🥷 Code experts: no user but you matched threshold 10

Zaid-maker has most 👩‍💻 activity in the files.
Zaid-maker has most 🧠 knowledge in the files.

See details

app/api/webhooks/clerk/route.ts

Activity based on git-commit:

Zaid-maker
DEC 100 additions & 9 deletions
NOV
OCT
SEP
AUG
JUL

Knowledge based on git-blame:
Zaid-maker: 100%

package-lock.json

Activity based on git-commit:

Zaid-maker
DEC 5794 additions & 117 deletions
NOV
OCT
SEP
AUG
JUL

Knowledge based on git-blame:
Zaid-maker: 100%

package.json

Activity based on git-commit:

Zaid-maker
DEC 51 additions & 6 deletions
NOV
OCT
SEP
AUG
JUL

Knowledge based on git-blame:
Zaid-maker: 100%

prisma/schema.prisma

Activity based on git-commit:

Zaid-maker
DEC 64 additions & 0 deletions
NOV
OCT
SEP
AUG
JUL

Knowledge based on git-blame:
Zaid-maker: 100%

To learn more about /:\ gitStream - Visit our Docs

@Zaid-maker Zaid-maker merged commit b1ea94b into main Dec 21, 2023
8 checks passed
@Zaid-maker
Copy link
Owner Author

Merge activity

@Zaid-maker Zaid-maker deleted the stream-model branch December 21, 2023 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant