Skip to content

[Backend] Guild Member Leave Event Handling #403

@gabito1451

Description

@gabito1451

Independence Note: Focus on the cleanup logic. Mock the authorization check.

Context:
When a member leaves a guild, we need to gracefully remove their membership record and log the departure.

Objective:
Implement a clean DELETE /guilds/:id/members/me endpoint.

Acceptance Criteria:

  • Ensure the user is currently a member of the guild.
  • Delete the GuildMembership record in Prisma.
  • Append a 'MEMBER_LEFT' event to the GuildActivityLog.
  • Handle errors where the user tries to leave a guild they aren't in.

Technical Pointers:

  • Add a guard to prevent the last remaining Admin from leaving without promoting someone else first.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions