update

abstract suspend fun update(facilityId: Int, verified: Boolean): AFResult

Updates the verification status of a facility.

If verified is true, the facility will be marked as verified. If false, the facility will be marked as blacklisted. If the facility does not exist locally, it will be added automatically.

Return

true if the facility was updated successfully; false otherwise.

Parameters

facilityId

The unique identifier of the facility to update.

verified

Whether the facility should be marked as verified (true) or blacklisted (false).

Throws

if the update fails.

Android (Kotlin)

lifecycleScope.launch {
val ok = AFCore.facilities().update(facilityId = 12345, verified = true)
if (ok) refreshFacilitiesUI() else showError("Update failed")
}

iOS (Swift)

Task {
do {
let ok = try await AFCore.shared.facilities().update(facilityId: 12345, verified: true)
ok ? self.refreshFacilitiesUI() : self.showError("Update failed")
} catch {
self.showError("Update failed: \\(error.localizedDescription)")
}
}