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: Blocked Service #12

Merged
merged 10 commits into from
Dec 18, 2023
Merged

feat: Blocked Service #12

merged 10 commits into from
Dec 18, 2023

Conversation

Zaid-maker
Copy link
Owner

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


Generated summary (powered by Graphite)

TL;DR

This pull request adds functionality for blocking and unblocking users. It introduces new files block.ts and block-service.ts, and modifies existing files actions.tsx and page.tsx. It also updates the Prisma schema to include the Block model.

What changed

  • Added block.ts file with onBlock and onUnblock functions for blocking and unblocking users respectively.
  • Added block-service.ts file with functions for checking if a user is blocked, blocking a user, unblocking a user, and getting a list of blocked users.
  • Modified actions.tsx to include a new button for blocking a user and added the handleBlock function to handle the block action.
  • Modified page.tsx to check if a user is blocked before displaying their profile.
  • Updated the Prisma schema to include the Block model.

How to test

  1. Run the application.
  2. Navigate to a user's profile page.
  3. Verify that the "Block" button is displayed.
  4. Click the "Block" button and verify that the user is blocked.
  5. Refresh the page and verify that the user's profile is no longer accessible.
  6. Unblock the user and verify that their profile is accessible again.

Why make this change

This change adds the ability for users to block and unblock other users. This can be useful for managing interactions and preventing unwanted communication. Blocking a user will prevent them from accessing your profile and interacting with you. Unblocking a user will restore their access and allow them to interact with you again. This feature enhances the user experience and provides more control over personal interactions on the platform.

Copy link

semanticdiff-com bot commented Dec 17, 2023

Review changes with SemanticDiff.

Analyzed 6 of 7 files.

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

Filename Status
✔️ actions/block.ts Analyzed
✔️ app/(browse)/[username]/_components/actions.tsx 7.14% smaller
✔️ app/(browse)/[username]/page.tsx 27.07% smaller
✔️ lib/block-service.ts Analyzed
✔️ lib/follow-service.ts Analyzed
✔️ lib/recommended-service.ts Analyzed
prisma/schema.prisma Unsupported file format

Copy link

vercel bot commented Dec 17, 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 18, 2023 6:09pm

Copy link

gitstream-cm bot commented Dec 18, 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/(browse)/[username]/_components/actions.tsx

Activity based on git-commit:

Zaid-maker
DEC 59 additions & 8 deletions
NOV
OCT
SEP
AUG
JUL

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

app/(browse)/[username]/page.tsx

Activity based on git-commit:

Zaid-maker
DEC 32 additions & 3 deletions
NOV
OCT
SEP
AUG
JUL

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

lib/follow-service.ts

Activity based on git-commit:

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

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

lib/recommended-service.ts

Activity based on git-commit:

Zaid-maker
DEC 114 additions & 65 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 48 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 88aecaa into main Dec 18, 2023
9 of 10 checks passed
@Zaid-maker Zaid-maker deleted the blocked-service branch December 18, 2023 18:10
@Zaid-maker
Copy link
Owner Author

Merge activity

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