Skip to content

feat(#213): add update POC functionality with API integration#214

Merged
iamitprakash merged 4 commits intodevelopfrom
anuj/feat-poc-change
Oct 16, 2025
Merged

feat(#213): add update POC functionality with API integration#214
iamitprakash merged 4 commits intodevelopfrom
anuj/feat-poc-change

Conversation

@AnujChhikara
Copy link
Contributor

@AnujChhikara AnujChhikara commented Oct 9, 2025

Date: 9 Oct, 2025

Developer Name: @AnujChhikara


Issue Ticket Number

Description

  • Added the functionality to assign PoC role
  • Admin and owner now can assign anyone PoC role

Documentation Updated?

  • Yes
  • No

Under Feature Flag

  • Yes
  • No

Database Changes

  • Yes
  • No

Breaking Changes

  • Yes
  • No

Development Tested?

  • Yes
  • No

Screenshots

Screenshot 1
Screen.Recording.2025-10-12.at.1.22.49.AM.mov

Test Coverage

Screenshot 1

Additional Notes

Description by Korbit AI

What change is being made?

Implement update POC functionality by adding a new UpdateTeamParams type, a TeamsApi.updateTeam endpoint, and UI integration in TeamMembers to appoint a member as POC with optimistic UI feedback and cache invalidation.

Why are these changes being made?

Enable updating a team's POC via API and reflect the change in the UI, including proper user feedback and cache invalidation for related data.

Is this description stale? Ask me to generate a new description by commenting /korbit-generate-pr-description

@coderabbitai
Copy link

coderabbitai bot commented Oct 9, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Summary by CodeRabbit

  • New Features
    • Admins can appoint a team member as Point of Contact (POC) directly from the team members list via the actions menu.
    • The action provides real-time feedback: success and error toasts, and the menu option is disabled while processing.
    • Team details refresh automatically after appointment, ensuring the new POC is reflected immediately across views.
    • Available for any non-POC member, enabling quick updates to team ownership.

Walkthrough

Adds a new Teams API method and type to update a team’s POC, and integrates a UI action in team-members to appoint a POC with mutation, query invalidation, and toast notifications.

Changes

Cohort / File(s) Summary of changes
Teams API additions
src/api/teams/teams.api.ts, src/api/teams/teams.type.ts
Introduced UpdateTeamPocParams type. Added TeamsApi.updateTeamPoc to PATCH /v1/teams/{teamId} with { poc_id }, returning TeamDto.
Team members UI POC action
src/components/teams/team-members.tsx
Added mutation to appoint POC, handlers for success/error, query invalidation for team-by-id, and UI menu item “Appoint as POC” with pending-state disablement.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant UI as TeamMembers UI
  participant Mut as updatePocMutation
  participant API as TeamsApi.updateTeamPoc
  participant Srv as Server
  participant QC as QueryClient

  User->>UI: Click "Appoint as POC" on member
  UI->>Mut: mutate({ teamId, poc_id })
  Mut->>API: PATCH /v1/teams/{teamId} { poc_id }
  API->>Srv: Request
  Srv-->>API: 200 TeamDto
  API-->>Mut: TeamDto
  Mut-->>UI: onSuccess
  UI->>QC: invalidateQueries(team-by-id)
  QC->>Srv: refetch team-by-id
  Srv-->>QC: TeamDto (updated POC)
  QC-->>UI: updated data
  UI-->>User: Success toast and refreshed view

  alt Error
    Srv-->>API: Error
    API-->>Mut: Error
    Mut-->>UI: onError
    UI-->>User: Error toast
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • iamitprakash

Poem

A rabbit taps code with a gentle hop,
Appointing POCs with a patch-and-pop.
Queries refresh, toasts cheer the scene,
Teams hop forward, tidy and clean.
Patch, nibble, refetch—what a treat! 🥕
Ship it swift on bunny feet.

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The title succinctly describes the primary feature being introduced—updating the point of contact via the API—and directly references the relevant issue, making it clear and specific to the main change in the pull request.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
Description Check ✅ Passed The PR description provided by the author states "Added the functionality to assign PoC role" and "Admin and owner now can assign anyone PoC role," which directly aligns with the changeset. The raw summary confirms that the changes include a new API method (updateTeamPoc), a new type (UpdateTeamPocParams), and UI updates in the team-members component to enable appointing members as POC. The description accurately captures the purpose of these changes, even though it is brief. The description is clearly related to the implementation and not off-topic.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch anuj/feat-poc-change

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@AnujChhikara AnujChhikara self-assigned this Oct 9, 2025
Copy link

@korbit-ai korbit-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review by Korbit AI

Korbit automatically attempts to detect when you fix issues in new commits.
Category Issue Status
Functionality Cache key function parameter mismatch ▹ view
Readability Redundant Type Annotation ▹ view
Error Handling Missing error context in POC update failure ▹ view
Design Inconsistent property naming convention ▹ view
Documentation Unclear POC abbreviation in parameter name ▹ view
Performance Race condition between cache invalidation and UI update ▹ view
Security Insufficient permission checks for POC appointment ▹ view
Files scanned
File Path Reviewed
src/api/teams/teams.type.ts
src/api/teams/teams.api.ts
src/components/teams/team-members.tsx

Explore our documentation to understand the languages and file types we support and the files we ignore.

Check out our docs on how you can make Korbit work best for you and your team.

Loving Korbit!? Share us on LinkedIn Reddit and X

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8df4d65 and b8ba0bc.

📒 Files selected for processing (3)
  • src/api/teams/teams.api.ts (2 hunks)
  • src/api/teams/teams.type.ts (1 hunks)
  • src/components/teams/team-members.tsx (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
src/api/teams/teams.api.ts (2)
src/api/teams/teams.type.ts (2)
  • UpdateTeamPocParams (161-164)
  • TeamDto (38-38)
src/lib/api-client.ts (1)
  • apiClient (6-10)
src/components/teams/team-members.tsx (1)
src/api/teams/teams.api.ts (1)
  • TeamsApi (16-115)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Cloudflare Pages

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Oct 9, 2025

Deploying todo-frontend with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7ba92f4
Status: ✅  Deploy successful!
Preview URL: https://fcfe6877.todo-frontend-76p.pages.dev
Branch Preview URL: https://anuj-feat-poc-change.todo-frontend-76p.pages.dev

View logs

@iamitprakash iamitprakash requested review from amit-flx and removed request for amit-flx October 16, 2025 23:20
@iamitprakash iamitprakash merged commit 3635a1d into develop Oct 16, 2025
3 checks passed
@iamitprakash iamitprakash deleted the anuj/feat-poc-change branch October 16, 2025 23:20
@AnujChhikara AnujChhikara mentioned this pull request Oct 18, 2025
10 tasks
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.

Implement functionality to change the PoC (Point of Contact) role in teams

6 participants