Skip to content

Explicit logic for update invite handler #38

Open
@maxceem

Description

@maxceem

At the moment handler for updated invites https://github.com/topcoder-platform/project-processor-es/blob/feature/before-remove-invite-fix/src/services/ProcessorServiceProjectMemberInvite.js#L72-L75 always remove invite from the project because we don't have any other situations when we are calling this handler.

But this logic might be confusing. We have to make the logic more clear and explicit.

Add condition:

  1. If invite status is accepted, refused, request_rejected, request_approved, canceled, then remove invite from the list as we do now.
  2. If invite status is another one, then just update invite object in the list. (at the moment we never have such statuses in real life).

We already have a unit tests which check the first case.
Create another unit test that would check the second test. We have to more statuses left for testing: pending and requested. So for the unit test, we can create an invite in one of these statuses and change it to another status.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions