ron
05/25/2025, 8:46 AMval removed = _bloodPressureRecords.removeIf { it.id == id }
should work, but accroding to intellij, removeIf does not exist kotlin = "2.1.21", kotlinx-coroutines = "1.10.2", ktor = "3.1.3"Sergey Y.
05/25/2025, 9:00 AMron
05/25/2025, 9:12 AMprivate val _bloodPressureRecords = mutableStateListOf<BloodPressureRecord>()
val bloodPressureRecords: List<BloodPressureRecord> = _bloodPressureRecords
...
return try {
val response: HttpResponse = apiClient.delete("$BASE_URL/bloodpressure/$id")
if (response.status == HttpStatusCode.NoContent || response.status == HttpStatusCode.OK) {
// Successfully deleted on server, now remove from local list
val removed = _bloodPressureRecords.removeIf { it.id == id }
Sergey Y.
05/25/2025, 9:17 AMron
05/25/2025, 9:19 AMremoveAll {it.id == id}