mirror of
https://github.com/bitwarden/android.git
synced 2024-11-24 02:15:53 +03:00
PM-11265: Remove the leave organization API (#3811)
This commit is contained in:
parent
82d3b44712
commit
f1f16cfee5
4 changed files with 0 additions and 28 deletions
|
@ -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 com.x8bit.bitwarden.data.auth.datasource.network.model.OrganizationResetPasswordEnrollRequestJson
|
||||||
import retrofit2.http.Body
|
import retrofit2.http.Body
|
||||||
import retrofit2.http.GET
|
import retrofit2.http.GET
|
||||||
import retrofit2.http.POST
|
|
||||||
import retrofit2.http.PUT
|
import retrofit2.http.PUT
|
||||||
import retrofit2.http.Path
|
import retrofit2.http.Path
|
||||||
|
|
||||||
|
@ -38,12 +37,4 @@ interface AuthenticatedOrganizationApi {
|
||||||
suspend fun getOrganizationKeys(
|
suspend fun getOrganizationKeys(
|
||||||
@Path("id") organizationId: String,
|
@Path("id") organizationId: String,
|
||||||
): Result<OrganizationKeysResponseJson>
|
): Result<OrganizationKeysResponseJson>
|
||||||
|
|
||||||
/**
|
|
||||||
* Leaves the this organization.
|
|
||||||
*/
|
|
||||||
@POST("/organizations/{id}/leave")
|
|
||||||
suspend fun leaveOrganization(
|
|
||||||
@Path("id") organizationId: String,
|
|
||||||
): Result<Unit>
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,11 +38,4 @@ interface OrganizationService {
|
||||||
suspend fun getOrganizationKeys(
|
suspend fun getOrganizationKeys(
|
||||||
organizationId: String,
|
organizationId: String,
|
||||||
): Result<OrganizationKeysResponseJson>
|
): Result<OrganizationKeysResponseJson>
|
||||||
|
|
||||||
/**
|
|
||||||
* Leaves this organization.
|
|
||||||
*/
|
|
||||||
suspend fun leaveOrganization(
|
|
||||||
organizationId: String,
|
|
||||||
): Result<Unit>
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,9 +52,4 @@ class OrganizationServiceImpl(
|
||||||
.getOrganizationKeys(
|
.getOrganizationKeys(
|
||||||
organizationId = organizationId,
|
organizationId = organizationId,
|
||||||
)
|
)
|
||||||
|
|
||||||
override suspend fun leaveOrganization(
|
|
||||||
organizationId: String,
|
|
||||||
): Result<Unit> =
|
|
||||||
authenticatedOrganizationApi.leaveOrganization(organizationId = organizationId)
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -104,13 +104,6 @@ class OrganizationServiceTest : BaseServiceTest() {
|
||||||
val result = organizationService.getOrganizationKeys("orgId")
|
val result = organizationService.getOrganizationKeys("orgId")
|
||||||
assertTrue(result.isFailure)
|
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 = """
|
private const val ORGANIZATION_AUTO_ENROLL_STATUS_JSON = """
|
||||||
|
|
Loading…
Reference in a new issue