delete

abstract suspend fun delete(facilityId: Int): AFResult

Deletes a facility from the member’s list.

Return

true if the facility was deleted successfully; false otherwise.

Parameters

facilityId

The unique identifier of the facility to remove.

Throws

if the delete operation fails.

Android (Kotlin)

lifecycleScope.launch {
val ok = AFCore.facilities().delete(facilityId = 12345)
if (ok) removeItemFromUI(12345) else showError("Delete failed")
}

iOS (Swift)

Task {
do {
let ok = try await AFCore.shared.facilities().delete(facilityId: 12345)
ok ? self.removeItemFromUI(12345) : self.showError("Delete failed")
} catch {
self.showError("Delete failed: \\(error.localizedDescription)")
}
}