PM-11265: Remove the leave organization API (#3811)

This commit is contained in:
David Perez 2024-08-22 15:17:54 -05:00 committed by GitHub
parent 82d3b44712
commit f1f16cfee5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 0 additions and 28 deletions

View file

@ -5,7 +5,6 @@ import com.x8bit.bitwarden.data.auth.datasource.network.model.OrganizationKeysRe
import com.x8bit.bitwarden.data.auth.datasource.network.model.OrganizationResetPasswordEnrollRequestJson
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.PUT
import retrofit2.http.Path
@ -38,12 +37,4 @@ interface AuthenticatedOrganizationApi {
suspend fun getOrganizationKeys(
@Path("id") organizationId: String,
): Result<OrganizationKeysResponseJson>
/**
* Leaves the this organization.
*/
@POST("/organizations/{id}/leave")
suspend fun leaveOrganization(
@Path("id") organizationId: String,
): Result<Unit>
}

View file

@ -38,11 +38,4 @@ interface OrganizationService {
suspend fun getOrganizationKeys(
organizationId: String,
): Result<OrganizationKeysResponseJson>
/**
* Leaves this organization.
*/
suspend fun leaveOrganization(
organizationId: String,
): Result<Unit>
}

View file

@ -52,9 +52,4 @@ class OrganizationServiceImpl(
.getOrganizationKeys(
organizationId = organizationId,
)
override suspend fun leaveOrganization(
organizationId: String,
): Result<Unit> =
authenticatedOrganizationApi.leaveOrganization(organizationId = organizationId)
}

View file

@ -104,13 +104,6 @@ class OrganizationServiceTest : BaseServiceTest() {
val result = organizationService.getOrganizationKeys("orgId")
assertTrue(result.isFailure)
}
@Test
fun `leaveOrganization when response is success should return success`() = runTest {
server.enqueue(MockResponse())
val result = organizationService.leaveOrganization(organizationId = "orgId")
assertTrue(result.isSuccess)
}
}
private const val ORGANIZATION_AUTO_ENROLL_STATUS_JSON = """