8000 PM-11156: Remove leave organization API request by matt-livefront · Pull Request #853 · bitwarden/ios · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

PM-11156: Remove leave organization API request #853

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,6 @@ protocol OrganizationAPIService {
/// - Returns: A `SingleSignOnDetailsResponse`.
///
func getSingleSignOnDetails(email: String) async throws -> SingleSignOnDetailsResponse

/// Removes the user from an organization.
///
/// - Parameter organizationId: The organization's ID.
///
func leaveOrganization(organizationId: String) async throws
}

extension APIService: OrganizationAPIService {
Expand All @@ -42,8 +36,4 @@ extension APIService: OrganizationAPIService {
func getSingleSignOnDetails(email: String) async throws -> SingleSignOnDetailsResponse {
try await apiUnauthenticatedService.send(SingleSignOnDetailsRequest(email: email))
}

func leaveOrganization(organizationId: String) async throws {
_ = try await apiService.send(LeaveOrganizationRequest(organizationId: organizationId))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,27 +68,4 @@ class OrganizationAPIServiceTests: BitwardenTestCase {
SingleSignOnDetailsResponse(organizationIdentifier: "TeamLivefront", ssoAvailable: true)
)
}

/// `leaveOrganization(organizationId:)` removes the user from the organization.
func test_leaveOrganization() async throws {
client.result = .httpSuccess(testData: .emptyResponse)

await assertAsyncDoesNotThrow {
_ = try await subject.leaveOrganization(organizationId: "1")
}

let request = try XCTUnwrap(client.requests.first)
XCTAssertEqual(request.method, .post)
XCTAssertEqual(request.url.relativePath, "/api/organizations/1/leave")
XCTAssertNil(request.body)
}

/// `leaveOrganization(organizationId:)` throws an error if the request fails.
func test_leaveOrganization_httpFailure() async throws {
client.result = .httpFailure()

await assertAsyncThrows {
_ = try await subject.leaveOrganization(organizationId: "1")
}
}
}

This file was deleted.

This file was deleted.

Loading
0