Skip to content

Return an appropriate error when removing billable members

Vijay Hawoldar requested to merge vij-delete-billable-error into master

What does this MR do?

We recently added the ability to remove a billable group member via the REST API, which uncovered an unexpected edge case - not all billable members have Member DB records.

This is the case when a user is part of a group that was invited into another group.

This edge case caused confusion when using the API because the deletion service would complete successfully, so the response would be a 204 - No Content for those members, even though they weren't actually removed (due to having no Member record).

This MR seeks to address that problem by raising an appropriate error and returning a more useful error message.

Testing

curl --request DELETE \
  --url http://127.0.0.1:3000/api/v4/groups/:group_id/billable_members/:any_invalid_id \
  --header 'PRIVATE-TOKEN: <your private token>'

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Edited by Vijay Hawoldar

Merge request reports